-
Notifications
You must be signed in to change notification settings - Fork 2
93 lines (77 loc) · 2.27 KB
/
publish.yaml
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
name: Publish
on:
push:
branches:
- main
jobs:
generate-matrix:
name: Generate Job Matrix
runs-on: ubuntu-latest
outputs:
exists: ${{ steps.set-matrix.outputs.exists }}
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
fetch-tags: true
- uses: denoland/setup-deno@v2
with:
deno-version: v2.x
- run: deno run -A www/tasks/publish-matrix.ts
id: set-matrix
jsr:
if: needs.generate-matrix.outputs.exists
name: Publish ${{ matrix.name }}@${{matrix.version}} to JSR
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
needs: [generate-matrix]
strategy:
fail-fast: false
max-parallel: 6
matrix: ${{fromJSON(needs.generate-matrix.outputs.matrix)}}
steps:
- uses: actions/[email protected]
- uses: denoland/setup-deno@v2
- run: deno publish
working-directory: ${{ matrix.workspace }}
npm:
if: needs.generate-matrix.outputs.exists
name: Publish ${{ matrix.name }}@${{matrix.version}} to NPM
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
needs: [generate-matrix]
strategy:
fail-fast: false
max-parallel: 6
matrix: ${{fromJSON(needs.generate-matrix.outputs.matrix)}}
steps:
- uses: actions/[email protected]
- uses: denoland/setup-deno@v2
- uses: actions/setup-node@v4
with:
node-version: 20.x
registry-url: https://registry.npmjs.com
- run: deno run -A www/tasks/build-npm.ts ${{matrix.workspace}}
- run: npm publish --access=public --tag=next
working-directory: ${{matrix.workspace}}/build/npm
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
tag:
if: needs.generate-matrix.outputs.exists
name: "Tag Release"
runs-on: ubuntu-latest
needs: [generate-matrix, jsr, npm]
strategy:
fail-fast: false
matrix: ${{fromJSON(needs.generate-matrix.outputs.matrix)}}
steps:
- uses: actions/[email protected]
with:
token: ${{secrets.FRONTSIDEJACK_GITHUB_TOKEN}}
- run: git tag ${{ matrix.tagname }}
- run: git push origin --tags