-
Notifications
You must be signed in to change notification settings - Fork 12
88 lines (69 loc) · 1.91 KB
/
src-cd.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
name: Monorepo CD
on:
release:
types:
- published
env:
NODE_VERSION: 20
CWD: ./src
jobs:
get-version:
name: Get Version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get_version.outputs.version-without-v }}
steps:
- name: Get Version
id: get_version
uses: battila7/get-version-action@v2
- name: Log Version
shell: pwsh
run: Write-Host ${{ steps.get_version.outputs.version-without-v }}
ci:
needs:
- get-version
name: Run Monorepo CI
uses: ./.github/workflows/src-ci.yml
with:
version: ${{ needs.get-version.outputs.version }}
secrets: inherit
deploy:
needs:
- get-version
- ci
name: Deploy
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
cache-dependency-path: ${{ env.CWD }}/package-lock.json
registry-url: https://registry.npmjs.org/
- name: Install dependencies
working-directory: ${{ env.CWD }}
run: npm ci
- name: Download Build
uses: actions/download-artifact@v4
with:
name: Build
path: ${{ env.CWD }}/dist
- name: Get Latest Tag
uses: tobysmith568/npm-publish-latest-tag@v1
id: latest_tag
with:
package-json: ${{ env.CWD }}/dist/packages/generate-license-file/package.json
- name: Download Build
uses: actions/download-artifact@v4
with:
name: Build
path: ${{ env.CWD }}/dist
- name: Publish
working-directory: ${{ env.CWD }}
run: npx nx run-many --target publish --args="--tag=${{ steps.latest_tag.outputs.latest-tag }}"
env:
NODE_AUTH_TOKEN: ${{ secrets.npm_token }}