-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (82 loc) · 2.61 KB
/
Copy pathrelease.yml
File metadata and controls
98 lines (82 loc) · 2.61 KB
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
name: Release
on:
push:
branches: ["**"]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout current branch
uses: actions/checkout@f548e57e544e1ff5a4c46bf1e1b8685f8e4a348a # v6
- name: Setup NodeJS
uses: actions/setup-node@dda4788290998366da86b6a4f497909644397bb2 # v4
with:
node-version: 24
cache: "npm"
- name: Install dependencies
run: npm ci --no-audit
- name: Build project
run: npm run build
- name: Test project
run: npm run test
- name: Compress dist/ directory to targets.tar
run: tar cf targets.tar dist
- name: Upload targets.tar
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main')
with:
name: target-${{ runner.os }}
path: targets.tar
retention-days: 1
release:
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
if: github.ref == 'refs/heads/main'
environment:
name: production
steps:
- name: Checkout current branch
uses: actions/checkout@f548e57e544e1ff5a4c46bf1e1b8685f8e4a348a # v6
with:
persist-credentials: false
- name: Setup NodeJS
uses: actions/setup-node@dda4788290998366da86b6a4f497909644397bb2 # v4
with:
node-version: 24
cache: "npm"
registry-url: https://registry.npmjs.org/
- name: Install dependencies
run: npm ci --no-audit
- name: Download target directories
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: target-${{ runner.os }}
- name: Inflate target directories
run: |
tar xf targets.tar
rm targets.tar
- name: Create GitHub App Token
id: app-token
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v2.2.0
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Publish project
uses: cycjimmy/semantic-release-action@b12c8f6015dc215fe37bc154d4ad456dd3833c90 # v6
id: semantic
with:
semantic_version: 25.0.2
extra_plugins: |
@semantic-release/changelog
@semantic-release/git
branches: |
[
"main"
]
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}