-
Notifications
You must be signed in to change notification settings - Fork 148
232 lines (207 loc) · 8.69 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
226
227
228
229
230
231
232
name: Release
on:
push:
tags:
- "v*.*.*"
permissions: write-all
jobs:
check-versions:
runs-on: ubuntu-latest
outputs:
semver: ${{ steps.validate.outputs.semver }}
steps:
- name: 'Checkout'
uses: actions/checkout@v4
- name: 'Validate versions match (tag, backend, frontend, Android)'
id: validate
shell: bash
run: |
semver=$(git describe --tags --abbrev=0)
IFS=-
read -ra semverArray <<< $semver
tagV=$(echo ${semverArray[0]} | sed 's/v//')
clientV=$(jq -r .version frontend/package.json)
androidV=$(grep -oP '(?<=versionName ").*?((?=\-)|$)' mobile/android/app/build.gradle)
coordinatorV=$(jq -r .major version.json).$(jq -r .minor version.json).$(jq -r .patch version.json)
printf "Client version: ${clientV}\nCoordinator version: ${coordinatorV}\nGit tag version: ${tagV}\n"
if [ "$coordinatorV" = "$clientV" ] && [ "$coordinatorV" = "$tagV" ] && [ "$coordinatorV" = "$androidV" ]; then
echo "Versions match!"
echo '::set-output name=semver::'$semver
else
echo "Versions do not match! You might have forgotten to update the version on a component."; exit $ERRCODE;
fi
frontend-build:
uses: RoboSats/robosats/.github/workflows/frontend-build.yml@main
needs: check-versions
with:
semver: ${{ needs.check-versions.outputs.semver }}
integration-tests:
uses: RoboSats/robosats/.github/workflows/integration-tests.yml@main
needs: [frontend-build, check-versions]
coordinator-image:
uses: RoboSats/robosats/.github/workflows/coordinator-image.yml@main
needs: [frontend-build, integration-tests, check-versions]
secrets: inherit
with:
semver: ${{ needs.check-versions.outputs.semver }}
selfhosted-client-image:
uses: RoboSats/robosats/.github/workflows/selfhosted-client-image.yml@main
needs: [frontend-build, check-versions]
secrets: inherit
with:
semver: ${{ needs.check-versions.outputs.semver }}
web-client-image:
uses: RoboSats/robosats/.github/workflows/web-client-image.yml@main
needs: [frontend-build, check-versions]
secrets: inherit
with:
semver: ${{ needs.check-versions.outputs.semver }}
android-build:
uses: RoboSats/robosats/.github/workflows/android-build.yml@main
needs: [frontend-build, check-versions]
secrets: inherit
with:
semver: ${{ needs.check-versions.outputs.semver }}
desktop-build:
uses: RoboSats/robosats/.github/workflows/desktop-build.yml@main
needs: [frontend-build, check-versions]
secrets: inherit
with:
semver: ${{ needs.check-versions.outputs.semver }}
release:
needs: [check-versions, integration-tests, coordinator-image, selfhosted-client-image, web-client-image, android-build, desktop-build]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Release
id: create-release
uses: softprops/action-gh-release@v2
with:
body_path: release_notes.md
generate_release_notes: true
# Upload app-universal-release APK artifact asset
- name: 'Download universal APK Artifact'
uses: actions/download-artifact@v4
with:
name: robosats-${{ needs.check-versions.outputs.semver }}-universal.apk
path: .
- name: 'Upload universal APK Asset'
id: upload-universal-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: app-universal-release.apk
asset_name: robosats-${{ needs.check-versions.outputs.semver }}-universal.apk
asset_content_type: application/apk
# Upload app-arm64-v8a-release APK artifact asset
- name: 'Download arm64-v8a APK Artifact'
uses: actions/download-artifact@v4
with:
name: robosats-${{ needs.check-versions.outputs.semver }}-arm64-v8a.apk
path: .
- name: 'Upload arm64-v8a APK Asset'
id: upload-arm64-v8a-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: app-arm64-v8a-release.apk
asset_name: robosats-${{ needs.check-versions.outputs.semver }}-arm64-v8a.apk
asset_content_type: application/apk
# Upload app-armeabi-v7a-release APK artifact asset
- name: 'Download armeabi-v7a APK Artifact'
uses: actions/download-artifact@v4
with:
name: robosats-${{ needs.check-versions.outputs.semver }}-armeabi-v7a.apk
path: .
- name: 'Upload armeabi-v7a APK Asset'
id: upload-armeabi-v7a-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: app-armeabi-v7a-release.apk
asset_name: robosats-${{ needs.check-versions.outputs.semver }}-armeabi-v7a.apk
asset_content_type: application/apk
# Upload app-x86_64-release APK artifact asset
- name: 'Download x86_64 APK Artifact'
uses: actions/download-artifact@v4
with:
name: robosats-${{ needs.check-versions.outputs.semver }}-x86_64.apk
path: .
- name: 'Upload x86_64 APK Asset'
id: upload-x86_64-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: app-x86_64-release.apk
asset_name: robosats-${{ needs.check-versions.outputs.semver }}-x86_64.apk
asset_content_type: application/apk
# Upload app-x86-release APK artifact asset
- name: 'Download x86 APK Artifact'
uses: actions/download-artifact@v4
with:
name: robosats-${{ needs.check-versions.outputs.semver }}-x86.apk
path: .
- name: 'Upload x86 APK Asset'
id: upload-x86-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: app-x86-release.apk
asset_name: robosats-${{ needs.check-versions.outputs.semver }}-x86.apk
asset_content_type: application/apk
- name: 'Download macOS Build Artifact'
uses: actions/download-artifact@v4
with:
name: robosats-desktop-${{ needs.check-versions.outputs.semver }}-mac-darwin-x64.zip
path: .
- name: 'Upload macOS Build Artifact'
id: upload-release-mac-zip-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: .
asset_name: robosats-desktop-${{ needs.check-versions.outputs.semver }}-mac-darwin-x64.zip
asset_content_type: application/zip
- name: 'Download linux Build Artifact'
uses: actions/download-artifact@v4
with:
name: robosats-desktop-${{ needs.check-versions.outputs.semver }}-linux-x64.zip
path: .
- name: 'Upload linux Build Artifact'
id: upload-release-linux-zip-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: robosats-desktop-${{ needs.check-versions.outputs.semver }}-linux-x64.zip
asset_name: robosats-desktop-${{ needs.check-versions.outputs.semver }}-linux-x64.zip
asset_content_type: application/zip
- name: 'Download window Build Artifact'
uses: actions/download-artifact@v4
with:
name: robosats-desktop-${{ needs.check-versions.outputs.semver }}-win32-ia32.zip
path: .
- name: 'Upload macOS Build Artifact'
id: upload-release-win-zip-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: robosats-desktop-${{ needs.check-versions.outputs.semver }}-win32-ia32.zip
asset_name: robosats-desktop-${{ needs.check-versions.outputs.semver }}-win32-ia32.zip
asset_content_type: application/zip