-
-
Notifications
You must be signed in to change notification settings - Fork 86
276 lines (243 loc) · 8.75 KB
/
release.yml
File metadata and controls
276 lines (243 loc) · 8.75 KB
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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
name: Release
on:
workflow_dispatch:
inputs:
developmentVersion:
description: "Default version to use for new local working copy."
required: true
default: "X.Y.Z-SNAPSHOT"
env:
WEBRTC_CACHE_BRANCH: 7339
WEBRTC_CHECKOUT_FOLDER: webrtc
WEBRTC_INSTALL_FOLDER: webrtc/build
jobs:
changelog:
name: Generate changelog
runs-on: ubuntu-latest
outputs:
release_body: ${{ steps.git-cliff.outputs.content }}
release_version: ${{ steps.git-cliff.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Git config
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Generate changelog for the current build
uses: orhun/git-cliff-action@v4
id: git-cliff
with:
config: .github/changelog/cliff-release.toml
args: -v -u --strip footer --bump --use-branch-tags
- name: Update CHANGELOG.md
uses: orhun/git-cliff-action@v4
with:
config: .github/changelog/cliff.toml
args: -v --bump --use-branch-tags
env:
OUTPUT: CHANGELOG.md
- name: Commit CHANGELOG.md
run: |
git add CHANGELOG.md
git commit -m "chore(release): Update CHANGELOG.md for ${{ steps.git-cliff.outputs.version }}"
git push
prepare-release:
name: Prepare release
needs: changelog
outputs:
release_body: ${{ needs.changelog.outputs.release_body }}
release_version: ${{ needs.changelog.outputs.release_version }}
strategy:
fail-fast: false
matrix:
platform:
- name: linux_x86-64
runs-on: ubuntu-22.04
runs-on: ${{ matrix.platform.runs-on }}
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
ref: main
- run: |
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com"
- id: prepare
name: Prepare release build
uses: ./.github/actions/prepare-linux
- name: Set up Java
uses: actions/setup-java@v5
with:
java-version: '21'
distribution: 'temurin'
server-id: central
server-username: MAVEN_USERNAME
server-password: MAVEN_TOKEN
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Update development version
uses: actions/checkout@v5
with:
ref: main
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
- run: |
mvn release:prepare -DskipTests -DpushChanges=false -DdevelopmentVersion=${{ github.event.inputs.developmentVersion }}
# Get the release version from the release.properties file
RELEASE_VERSION=$(grep "project.rel.dev.onvoid.webrtc\\\:webrtc-java=" release.properties | cut -d'=' -f2)
echo "Extracted release version from release.properties: $RELEASE_VERSION"
# Update versions.ts file
echo "Updating versions.ts with release version: $RELEASE_VERSION and development version: ${{ github.event.inputs.developmentVersion }}"
sed -i "s/VERSION: '.*'/VERSION: '$RELEASE_VERSION'/g" docs/.vitepress/versions.ts
sed -i "s/VERSION_SNAPSHOT: '.*'/VERSION_SNAPSHOT: '${{ github.event.inputs.developmentVersion }}'/g" docs/.vitepress/versions.ts
# Add the updated file to the existing commit
git add docs/.vitepress/versions.ts
git commit --amend --no-edit
git push
git push --tags
build-windows:
needs: prepare-release
outputs:
release_body: ${{ needs.prepare-release.outputs.release_body }}
release_version: ${{ needs.prepare-release.outputs.release_version }}
strategy:
fail-fast: false
matrix:
platform:
- name: windows_x86_64
runs-on: windows-2022
java: [17]
runs-on: ${{ matrix.platform.runs-on }}
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
fetch-tags: true
- name: Get tag from current branch
id: tag-selector
shell: bash
run: |
git fetch -a
tag=$(git describe --tags `git rev-list --tags --max-count=1`)
echo "tag=$tag" >> "$GITHUB_OUTPUT"
git checkout $tag
- id: prepare
name: Prepare release build
uses: ./.github/actions/prepare-windows
- id: maven-build
name: Maven build
uses: ./.github/actions/release
with:
java-version: ${{ matrix.java }}
platform-name: ${{ matrix.platform.name }}
maven-username: ${{ secrets.MAVEN_USERNAME }}
maven-password: ${{ secrets.MAVEN_TOKEN }}
maven-gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
maven-gpg-passphrase: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
build-linux:
needs: prepare-release
strategy:
fail-fast: false
matrix:
platform:
- name: linux_arm
runs-on: ubuntu-22.04
- name: linux_arm64
runs-on: ubuntu-22.04
- name: linux_x86-64
runs-on: ubuntu-22.04
java: [17]
runs-on: ${{ matrix.platform.runs-on }}
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
fetch-tags: true
- name: Get tag from current branch
id: tag-selector
run: |
git fetch -a
tag=$(git describe --tags `git rev-list --tags --max-count=1`)
echo "tag=$tag" >> "$GITHUB_OUTPUT"
git checkout $tag
- id: prepare-build
name: Prepare release build
uses: ./.github/actions/prepare-linux
- id: maven-build
name: Maven build
uses: ./.github/actions/release
with:
java-version: ${{ matrix.java }}
platform-name: ${{ matrix.platform.name }}
maven-username: ${{ secrets.MAVEN_USERNAME }}
maven-password: ${{ secrets.MAVEN_TOKEN }}
maven-gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
maven-gpg-passphrase: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
build-macos:
needs: prepare-release
strategy:
fail-fast: false
matrix:
platform:
- name: macos_x86-64
runs-on: macos-14
- name: macos_arm64
runs-on: macos-14
java: [17]
runs-on: ${{ matrix.platform.runs-on }}
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
fetch-tags: true
- name: Get tag from current branch
id: tag-selector
run: |
git fetch -a
tag=$(git describe --tags `git rev-list --tags --max-count=1`)
echo "tag=$tag" >> "$GITHUB_OUTPUT"
git checkout $tag
- id: prepare-build
name: Prepare release build
uses: ./.github/actions/prepare-macos
- id: maven-build-arm64
name: Maven build - Apple Silicon
if: matrix.platform.name == 'macos_arm64'
uses: ./.github/actions/release
with:
java-version: ${{ matrix.java }}
platform-name: ${{ matrix.platform.name }}
maven-username: ${{ secrets.MAVEN_USERNAME }}
maven-password: ${{ secrets.MAVEN_TOKEN }}
maven-gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
maven-gpg-passphrase: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
- id: maven-build-x86_64
name: Maven build - Intel
if: matrix.platform.name == 'macos_x86-64'
uses: ./.github/actions/release-macos-x86_64
with:
java-version: ${{ matrix.java }}
platform-name: ${{ matrix.platform.name }}
maven-username: ${{ secrets.MAVEN_USERNAME }}
maven-password: ${{ secrets.MAVEN_TOKEN }}
maven-gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
maven-gpg-passphrase: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
publish-release:
name: Publish GitHub release
needs: [build-windows, build-linux, build-macos]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Publish
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
version="${{ needs.build-windows.outputs.release_version }}"
body="${{ needs.build-windows.outputs.release_body }}"
gh release create $version -d -t "Release $version" -n "$body"