-
Notifications
You must be signed in to change notification settings - Fork 2
307 lines (304 loc) · 11.6 KB
/
release-comlink.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
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
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
name: Release comlink package
on:
workflow_dispatch:
inputs:
release-level:
description: "Release level"
required: true
type: choice
default: prerelease
options:
- prerelease
- patch
- minor
- major
release-kind:
description: "Release kind"
required: false
type: choice
default: alpha
options:
- alpha
- beta
- rc
- stable
package:
required: true
type: choice
options:
- map_std
- nodejs_comlink
- comlink_language_server
jobs:
map-std-prepare:
name: Prepare Map std
if: ${{ inputs.package == 'map_std' }}
runs-on: ubuntu-latest
env:
PACKAGE_PATH: packages/map_std
PACKAGE_TAG: mapstd
outputs:
RELEASE_VERSION: ${{ steps.prepare_package.outputs.RELEASE_VERSION }}
RELEASE_LEVEL: ${{ steps.prepare_package.outputs.RELEASE_LEVEL }}
RELEASE_TAG: ${{ steps.prepare_package.outputs.RELEASE_TAG }}
RELEASE_PREID: ${{ steps.prepare_package.outputs.RELEASE_PREID }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/package_prepare
id: prepare_package
with:
RELEASE_LEVEL: ${{ inputs.release-level }}
RELEASE_KIND: ${{ inputs.release-kind }}
PACKAGE_PATH: ${{ env.PACKAGE_PATH }}
- uses: actions/setup-node@v4
with:
registry-url: https://registry.npmjs.org/
node-version: "18"
cache: yarn
cache-dependency-path: core_js/yarn.lock
- name: Update version in package.json
working-directory: ${{ env.PACKAGE_PATH }}
run: yarn version --no-git-tag-version --new-version ${{ steps.prepare_package.outputs.RELEASE_VERSION }}
- name: Build
working-directory: core_js
run: |
yarn install --frozen-lockfile
yarn workspace @superfaceai/map-std build
cp -r map-std/types ../${{ env.PACKAGE_PATH }}/
- name: Commit package.json, VERSION, CHANGELOG.md and create git tag
working-directory: ${{ env.PACKAGE_PATH }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git add package.json VERSION CHANGELOG.md
git commit -m "chore: release ${{ env.PACKAGE_PATH }} ${{ steps.prepare_package.outputs.RELEASE_VERSION }}"
git tag "${{ env.PACKAGE_TAG }}-v${{ steps.prepare_package.outputs.RELEASE_VERSION }}"
git push origin
git push origin --tags
- name: Update GitHub release documentation
uses: softprops/action-gh-release@v1
with:
tag_name: "${{ env.PACKAGE_TAG }}-v${{ steps.prepare_package.outputs.RELEASE_VERSION }}"
body: ${{ steps.prepare_package.outputs.CHANGELOG }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
map-std-publish:
name: Publish Map Std
needs: [map-std-prepare]
if: ${{ !cancelled() && needs.map-std-prepare.result == 'success' }}
runs-on: ubuntu-latest
env:
PACKAGE_PATH: packages/map_std
steps:
# Setup
- uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
- uses: actions/setup-node@v4
with:
registry-url: https://registry.npmjs.org/
node-version: "18"
cache: yarn
cache-dependency-path: core_js/yarn.lock
# Build
- name: Copy LICENSE
run: cp LICENSE ${{ env.PACKAGE_PATH }}/LICENSE
- name: Build
working-directory: core_js
run: |
yarn install --frozen-lockfile
yarn workspace @superfaceai/map-std build
cp -r map-std/types ../${{ env.PACKAGE_PATH }}/
# Publish
- name: Publish to NPM registry
working-directory: ${{ env.PACKAGE_PATH }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_BOT_PAT }}
run: yarn publish --verbose --no-git-tag-version --access public --new-version ${{ needs.map-std-prepare.outputs.RELEASE_VERSION }} --tag ${{ needs.map-std-prepare.outputs.RELEASE_TAG }}
comlink:
name: Comlink WASM
if: ${{ inputs.package == 'nodejs_comlink' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/build_core
with:
CARGO_PROFILE: 'release'
COMLINK_WASM: 'upload'
nodejs-comlink-prepare:
name: Prepare Node.js Comlink
needs: [comlink]
if: ${{ !cancelled() && needs.comlink.result == 'success' && inputs.package == 'nodejs_comlink' }}
runs-on: ubuntu-latest
env:
PACKAGE_PATH: packages/nodejs_comlink
PACKAGE_TAG: nodejs_comlink
outputs:
RELEASE_VERSION: ${{ steps.prepare_package.outputs.RELEASE_VERSION }}
RELEASE_LEVEL: ${{ steps.prepare_package.outputs.RELEASE_LEVEL }}
RELEASE_TAG: ${{ steps.prepare_package.outputs.RELEASE_TAG }}
RELEASE_PREID: ${{ steps.prepare_package.outputs.RELEASE_PREID }}
steps:
# setup
- uses: actions/checkout@v4
- uses: ./.github/actions/package_prepare
id: prepare_package
with:
RELEASE_LEVEL: ${{ inputs.release-level }}
RELEASE_KIND: ${{ inputs.release-kind }}
PACKAGE_PATH: ${{ env.PACKAGE_PATH }}
- uses: actions/setup-node@v4
with:
registry-url: https://registry.npmjs.org/
node-version: "18"
cache: yarn
cache-dependency-path: ${{ env.PACKAGE_PATH }}/yarn.lock
- uses: actions/download-artifact@v4
with:
name: comlink-wasm
path: ${{ env.PACKAGE_PATH }}/assets
# version and changelog
- name: Update version in package.json
working-directory: ${{ env.PACKAGE_PATH }}
run: yarn version --no-git-tag-version --new-version ${{ steps.prepare_package.outputs.RELEASE_VERSION }}
- name: Build
working-directory: ${{ env.PACKAGE_PATH }}
run: |
yarn install --frozen-lockfile
yarn build
- name: Commit package.json, VERSION, CHANGELOG.md and create git tag
working-directory: ${{ env.PACKAGE_PATH }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git add package.json VERSION CHANGELOG.md
git commit -m "chore: release ${{ env.PACKAGE_PATH }} ${{ steps.prepare_package.outputs.RELEASE_VERSION }}"
git tag "${{ env.PACKAGE_TAG }}-v${{ steps.prepare_package.outputs.RELEASE_VERSION }}"
git push origin
git push origin --tags
- name: Update GitHub release documentation
uses: softprops/action-gh-release@v1
with:
tag_name: "${{ env.PACKAGE_TAG }}-v${{ steps.prepare_package.outputs.RELEASE_VERSION }}"
body: ${{ steps.prepare_package.outputs.CHANGELOG }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
nodejs-comlink-publish:
name: Publish Node.js Comlink
needs: [comlink, nodejs-comlink-prepare]
if: ${{ !cancelled() && needs.nodejs-comlink-prepare.result == 'success' }}
runs-on: ubuntu-latest
env:
PACKAGE_PATH: packages/nodejs_comlink
steps:
# Setup
- uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
- uses: actions/setup-node@v4
with:
registry-url: https://registry.npmjs.org/
node-version: "18"
cache: yarn
cache-dependency-path: ${{ env.PACKAGE_PATH }}/yarn.lock
# Build
- uses: actions/download-artifact@v4
with:
name: comlink-wasm
path: ${{ env.PACKAGE_PATH }}/assets
- name: Copy LICENSE
run: cp LICENSE ${{ env.PACKAGE_PATH }}/LICENSE
- name: Build
working-directory: ${{ env.PACKAGE_PATH }}
run: |
yarn install --frozen-lockfile
yarn build
# Publish
- name: Publish to NPM registry
working-directory: ${{ env.PACKAGE_PATH }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_BOT_PAT }}
run: yarn publish --verbose --no-git-tag-version --access public --new-version ${{ needs.nodejs-comlink-prepare.outputs.RELEASE_VERSION }} --tag ${{ needs.nodejs-comlink-prepare.outputs.RELEASE_TAG }}
comlink-language-server-prepare:
name: Prepare Comlink Language Server
if: ${{ inputs.package == 'comlink_language_server' }}
runs-on: ubuntu-latest
env:
PACKAGE_PATH: packages/comlink_language_server
PACKAGE_TAG: comlink_language_server
outputs:
RELEASE_VERSION: ${{ steps.prepare_package.outputs.RELEASE_VERSION }}
RELEASE_LEVEL: ${{ steps.prepare_package.outputs.RELEASE_LEVEL }}
RELEASE_TAG: ${{ steps.prepare_package.outputs.RELEASE_TAG }}
RELEASE_PREID: ${{ steps.prepare_package.outputs.RELEASE_PREID }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/package_prepare
id: prepare_package
with:
RELEASE_LEVEL: ${{ inputs.release-level }}
RELEASE_KIND: ${{ inputs.release-kind }}
PACKAGE_PATH: ${{ env.PACKAGE_PATH }}
- uses: actions/setup-node@v4
with:
registry-url: https://registry.npmjs.org/
node-version: "18"
cache: yarn
cache-dependency-path: ${{ env.PACKAGE_PATH }}/yarn.lock
- name: Update version in package.json
working-directory: ${{ env.PACKAGE_PATH }}
run: yarn version --no-git-tag-version --new-version ${{ steps.prepare_package.outputs.RELEASE_VERSION }}
- name: Build
working-directory: ${{ env.PACKAGE_PATH }}
run: |
yarn install --frozen-lockfile
yarn build
- name: Commit package.json, VERSION, CHANGELOG.md and create git tag
working-directory: ${{ env.PACKAGE_PATH }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git add package.json VERSION CHANGELOG.md
git commit -m "chore: release ${{ env.PACKAGE_PATH }} ${{ steps.prepare_package.outputs.RELEASE_VERSION }}"
git tag "${{ env.PACKAGE_TAG }}-v${{ steps.prepare_package.outputs.RELEASE_VERSION }}"
git push origin
git push origin --tags
- name: Update GitHub release documentation
uses: softprops/action-gh-release@v1
with:
tag_name: "${{ env.PACKAGE_TAG }}-v${{ steps.prepare_package.outputs.RELEASE_VERSION }}"
body: ${{ steps.prepare_package.outputs.CHANGELOG }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
comlink-language-server-publish:
name: Publish Comlink Language Server
needs: [comlink-language-server-prepare]
if: ${{ !cancelled() && needs.comlink-language-server-prepare.result == 'success' }}
runs-on: ubuntu-latest
env:
PACKAGE_PATH: packages/comlink_language_server
steps:
# Setup
- uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
- uses: actions/setup-node@v4
with:
registry-url: https://registry.npmjs.org/
node-version: "18"
cache: yarn
cache-dependency-path: ${{ env.PACKAGE_PATH }}/yarn.lock
# Build
- name: Copy LICENSE
run: cp LICENSE ${{ env.PACKAGE_PATH }}/LICENSE
- name: Build
working-directory: ${{ env.PACKAGE_PATH }}
run: |
yarn install --frozen-lockfile
yarn build
# Publish
- name: Publish to NPM registry
working-directory: ${{ env.PACKAGE_PATH }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_BOT_PAT }}
run: yarn publish --verbose --no-git-tag-version --access public --new-version ${{ needs.comlink-language-server-prepare.outputs.RELEASE_VERSION }} --tag ${{ needs.comlink-language-server-prepare.outputs.RELEASE_TAG }}