Skip to content

Commit 675aadd

Browse files
committed
CI: build assets
1 parent 6200e96 commit 675aadd

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/assets.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: "Assets"
2+
3+
on:
4+
workflow_dispatch:
5+
6+
push:
7+
branches: ["master"]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-node@v4
15+
- run: npm install
16+
- run: npm run build
17+
- uses: actions/upload-artifact@v4
18+
with:
19+
name: dist-files
20+
path: dist
21+
22+
publish:
23+
runs-on: ubuntu-latest
24+
needs: [build]
25+
steps:
26+
- uses: actions/checkout@v4
27+
- uses: actions/download-artifact@v4
28+
with:
29+
name: dist-files
30+
path: dist/
31+
- uses: actions/setup-node@v4
32+
- name: Generate version
33+
id: version
34+
run: |
35+
COMMIT_HASH=$(git rev-parse --short HEAD)
36+
DATE=$(date +'%Y%m%d')
37+
VERSION="0.0.0-$DATE-$COMMIT_HASH"
38+
echo "version=$VERSION" >> $GITHUB_OUTPUT
39+
- run: npm version ${{ steps.version.outputs.version }} --no-git-tag-version
40+
- run: npm publish --provenance --tag master
41+
env:
42+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)