-
Notifications
You must be signed in to change notification settings - Fork 57
225 lines (205 loc) · 7.79 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
#
# Copyright (c) 2022 ZettaScale Technology
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
# which is available at https://www.apache.org/licenses/LICENSE-2.0.
#
# SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
#
# Contributors:
# ZettaScale Zenoh Team, <[email protected]>
#
name: Release
on:
schedule:
- cron: "0 0 * * 1-5"
workflow_dispatch:
inputs:
live-run:
type: boolean
description: Live-run
required: false
version:
type: string
description: Release number
required: false
zenoh-version:
type: string
description: Release number of Zenoh
required: false
branch:
type: string
description: Release branch
required: false
jobs:
tag:
name: Branch, Bump & tag
runs-on: ubuntu-latest
outputs:
version: ${{ steps.create-release-branch.outputs.version }}
branch: ${{ steps.create-release-branch.outputs.branch }}
steps:
- id: create-release-branch
uses: eclipse-zenoh/ci/create-release-branch@main
with:
repo: ${{ github.repository }}
live-run: ${{ inputs.live-run || false }}
# NOTE(fuzzypixelz): When the version is undefined (e.g. on schedule
# events) we cannot use git-describe as CMake doesn't support it.
# However, we still need some placeholder version to test that the
# version can be reliably bumped.
version: ${{ inputs.version || '0.0.0' }}
branch: ${{ inputs.branch }}
github-token: ${{ secrets.BOT_TOKEN_WORKFLOW }}
- name: Checkout this repository
uses: actions/checkout@v4
with:
ref: ${{ steps.create-release-branch.outputs.branch }}
token: ${{ secrets.BOT_TOKEN_WORKFLOW }}
- name: Bump and tag project
run: bash ci/scripts/bump-and-tag.bash
env:
VERSION: ${{ steps.create-release-branch.outputs.version }}
BUMP_DEPS_VERSION: ${{ inputs.zenoh-version }}
BUMP_DEPS_PATTERN: ${{ inputs.zenoh-version && 'zenoh.*' || '' }}
BUMP_DEPS_BRANCH: ${{ inputs.zenoh-version && format('release/{0}', inputs.zenoh-version) || '' }}
GIT_USER_NAME: eclipse-zenoh-bot
GIT_USER_EMAIL: [email protected]
build:
name: Build packages
runs-on: ${{ matrix.build.os }}
strategy:
fail-fast: false
matrix:
build:
- { target: x86_64-unknown-linux-gnu, os: ubuntu-20.04 }
- { target: x86_64-unknown-linux-musl, os: ubuntu-20.04 }
- { target: arm-unknown-linux-gnueabi, os: ubuntu-20.04 }
- { target: arm-unknown-linux-gnueabihf, os: ubuntu-20.04 }
- { target: armv7-unknown-linux-gnueabihf, os: ubuntu-20.04 }
- { target: aarch64-unknown-linux-gnu, os: ubuntu-20.04 }
- { target: aarch64-unknown-linux-musl, os: ubuntu-20.04 }
- { target: x86_64-apple-darwin, os: macos-12 }
- { target: aarch64-apple-darwin, os: macos-12 }
- { target: x86_64-pc-windows-msvc, os: windows-2019 }
- { target: x86_64-pc-windows-gnu, os: windows-2019 }
needs: tag
steps:
- name: Checkout this repository
uses: actions/checkout@v4
with:
ref: ${{ needs.tag.outputs.branch }}
token: ${{ secrets.BOT_TOKEN_WORKFLOW }}
- name: Add rust toolchain
run: |
rustup target add ${{ matrix.build.target }}
- name: Install build deps
if: ${{ matrix.build.target == 'x86_64-unknown-linux-musl'}}
run: sudo apt-get install -y musl-tools
- name: Install build deps
if: ${{ matrix.build.target == 'arm-unknown-linux-gnueabi'}}
run: sudo apt-get install -y gcc-arm-linux-gnueabi
- name: Install build deps
if: ${{ matrix.build.target == 'arm-unknown-linux-gnueabihf'}}
run: sudo apt-get install -y gcc-arm-linux-gnueabihf
- name: Install build deps
if: ${{ matrix.build.target == 'armv7-unknown-linux-gnueabihf'}}
run: sudo apt-get install -y gcc-arm-linux-gnueabihf libc6-armhf-cross libc6-dev-armhf-cross
- name: Install build deps
if: ${{ matrix.build.target == 'aarch64-unknown-linux-gnu'}}
run: sudo apt-get install -y gcc-aarch64-linux-gnu
- name: Install build deps
if: ${{ matrix.build.target == 'aarch64-unknown-linux-musl'}}
run: |
wget https://musl.cc/aarch64-linux-musl-cross.tgz
tar xvfz aarch64-linux-musl-cross.tgz
- id: build
run: |
mkdir -p build && cd build
cmake .. -DZENOHC_CUSTOM_TARGET=${{ matrix.build.target }} -DCMAKE_TOOLCHAIN_FILE=../TC-${{ matrix.build.target }}.cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DZENOHC_BUILD_WITH_UNSTABLE_API=ON -DZENOHC_BUILD_WITH_SHARED_MEMORY=ON
cmake --build . --config Release
cpack -C Release -G ZIP
- id: build-distro-packages
if: ${{ matrix.build.os == 'ubuntu-20.04' }}
run: |
cd build
cpack -G DEB
cpack -G RPM
- name: Upload library archive
uses: actions/upload-artifact@v4
with:
name: zenohc-${{ inputs.version }}-${{ matrix.build.target }}-standalone.zip
path: ./build/packages/*.zip
- name: Upload DEB archive
if: ${{ matrix.build.os == 'ubuntu-20.04' }}
uses: actions/upload-artifact@v4
with:
name: libzenohc-${{ inputs.version }}-${{ matrix.build.target }}-debian.zip
path: ./build/packages/*.deb
- name: Upload RPM archive
if: ${{ matrix.build.os == 'ubuntu-20.04' }}
uses: actions/upload-artifact@v4
with:
name: libzenohc-${{ inputs.version }}-${{ matrix.build.target }}-rpm.zip
path: ./build/packages/*.rpm
debian:
name: Publish Debian packages
needs: [tag, build]
uses: eclipse-zenoh/ci/.github/workflows/release-crates-debian.yml@main
with:
no-build: true
live-run: ${{ inputs.live-run || false }}
version: ${{ needs.tag.outputs.version }}
repo: ${{ github.repository }}
branch: ${{ needs.tag.outputs.branch }}
installation-test: false
secrets: inherit
homebrew:
name: Publish Homebrew formulae
needs: [tag, build]
uses: eclipse-zenoh/ci/.github/workflows/release-crates-homebrew.yml@main
with:
no-build: true
repo: ${{ github.repository }}
live-run: ${{ inputs.live-run || false }}
version: ${{ needs.tag.outputs.version }}
branch: ${{ needs.tag.outputs.branch }}
artifact-patterns: |
^libzenohc\.dylib$
^include$
formulae: |
libzenohc
secrets: inherit
eclipse:
name: Publish artifacts to Eclipse downloads
needs: [tag, build]
uses: eclipse-zenoh/ci/.github/workflows/release-crates-eclipse.yml@main
with:
no-build: true
live-run: ${{ inputs.live-run || false }}
version: ${{ needs.tag.outputs.version }}
repo: ${{ github.repository }}
branch: ${{ needs.tag.outputs.branch }}
artifact-patterns: |
^libzenohc\.(dylib|so)$
^zenohc\.dll$
^include$
name: zenoh-c
secrets: inherit
github:
name: Publish artifacts to GitHub Releases
needs: [tag, build]
uses: eclipse-zenoh/ci/.github/workflows/release-crates-github.yml@main
with:
no-build: true
live-run: ${{ inputs.live-run || false }}
version: ${{ needs.tag.outputs.version }}
repo: ${{ github.repository }}
branch: ${{ needs.tag.outputs.branch }}
artifact-patterns: |
^libzenohc\.(dylib|so)$
^zenohc\.dll$
^include$
secrets: inherit