-
Notifications
You must be signed in to change notification settings - Fork 11
248 lines (208 loc) · 7.41 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
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
name: Release Packages
permissions:
contents: write
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
jobs:
# We need to verify the version in some packages with the tag in order to have the same version in all packages (python, csharp, angular, web).
# Some packages use an internal version (like csharp, angular and web) and some use the tag version (like python).
verify-versions:
name: Verify Versions
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
fetch-depth: 0
- run: npm i -g pnpm @antfu/ni
- name: Setup Node.js
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
with:
node-version: 18.x
cache: pnpm
- name: Install Dependencies
run: nci
- name: Verify Versions
run: nr verify-versions ${{ github.ref_name }}
release-csharp-packages:
needs: [verify-versions]
name: Release C# Packages
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
package:
- packages/csharp/ArmoniK.Api.Common.Channel/ArmoniK.Api.Common.Channel.csproj
- packages/csharp/ArmoniK.Api.Common/ArmoniK.Api.Common.csproj
- packages/csharp/ArmoniK.Api.Core/ArmoniK.Api.Core.csproj
- packages/csharp/ArmoniK.Api.Client/ArmoniK.Api.Client.csproj
- packages/csharp/ArmoniK.Api.Worker/ArmoniK.Api.Worker.csproj
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
fetch-depth: 0
- name: Install .NET Core
uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # v4
with:
dotnet-version: 6.x
- name: Build the package
run: |
dotnet build ${{ matrix.package }} -c Release
- name: Pack the package
run: |
dotnet pack ${{ matrix.package }} -c Release -o /tmp/packages
ls /tmp/packages
- name: Push the package
run: dotnet nuget push /tmp/packages/ArmoniK.Api.*.nupkg -k ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
release-python-package:
needs: [verify-versions]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
fetch-depth: 0
- name: pip update and add build package
run: |
cd ./packages/python
export RELEASE=true
bash proto2python.sh ~/pyvenv
- name: Upload as artifact
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a
with:
name: python-packages
path: packages/python/pkg/
- name: Publish to PyPITest
if: github.ref != 'refs/heads/main'
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.DEV_PYPI_API_TOKEN }}
print-hash: true
packages-dir: packages/python/pkg/
repository-url: https://test.pypi.org/legacy/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
print-hash: true
packages-dir: packages/python/pkg/
release-angular-packages:
needs: [verify-versions]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
fetch-depth: 0
- run: npm i -g pnpm @antfu/ni
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
with:
node-version: 18
cache: pnpm
registry-url: https://registry.npmjs.org/
- name: Install dependencies
run: nci && cd packages/angular && nci
- name: Install Protoc
run: sudo apt install -y protobuf-compiler
- name: Build protos
run: cd packages/angular && nr proto:generate:linux
- name: Build angular
run: cd packages/angular && nr build
- name: Release package
run: nr ci:publish angular dist/aneoconsultingfr/armonik.api.angular
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
release-web-packages:
needs: [verify-versions]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
fetch-depth: 0
- run: npm i -g pnpm @antfu/ni
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
with:
node-version: 18
cache: pnpm
registry-url: https://registry.npmjs.org/
- name: Install ni
run: npm i -g @antfu/ni pnpm
- name: Install dependencies
run: nci && cd packages/web && nci
- name: Install Protoc
run: sudo apt install -y protobuf-compiler
- name: Build protos
run: cd packages/web && nr proto:generate:linux
- name: Build web
run: cd packages/web && nr build
- name: Release package
run: nr ci:publish web
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
release-cpp-package:
needs: [verify-versions]
strategy:
fail-fast: false
matrix:
type: [tar.gz, deb, rpm]
name: Build C++ Packages [${{ matrix.type }}]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
ref: ${{ github.ref }}
- name: Build the package
run: |
cd packages/cpp/tools/packaging
./make-${{ matrix.type }}.sh
- name: Publish package as artefact
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a
with:
if-no-files-found: error
path: packages/cpp/tools/packaging/*.${{ matrix.type }}
name: libarmonik-${{ github.ref_name }}.${{ matrix.type }}
- name: Upload to release
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: |
gh release upload ${{ github.ref_name }} packages/cpp/tools/packaging/*.${{ matrix.type }}
release-java-package:
needs: [verify-versions]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Set up Maven Central Repository
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: temurin
server-id: central
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.GPG_SIGNING_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Publish package
run: |
cd packages/java
mvn --batch-mode deploy -DskipTests
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_SIGNING_KEY_PASSWORD }}
update-changelog:
needs: [verify-versions]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
fetch-depth: 0
- name: Set node
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
with:
node-version: 18
- run: npx changelogithub
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}