forked from AceDataCloud/Nexior
-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (56 loc) · 1.62 KB
/
Copy pathgithub-release.yaml
File metadata and controls
65 lines (56 loc) · 1.62 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
name: github-release
"on":
push:
tags:
- '@acedatacloud/nexior_v*'
- 'v*'
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: '22'
cache: npm
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Prepare metadata
id: meta
shell: bash
run: |
TAG="${GITHUB_REF_NAME}"
SAFE_TAG="${TAG//\//-}"
if [[ "$TAG" == *"_v"* ]]; then
VERSION="${TAG##*_v}"
else
VERSION="${TAG#v}"
fi
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
echo "safe_tag=${SAFE_TAG}" >> "$GITHUB_OUTPUT"
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
- name: Package dist
shell: bash
run: |
ASSET="nexior-dist-${{ steps.meta.outputs.safe_tag }}.tar.gz"
tar -czf "$ASSET" dist
sha256sum "$ASSET" > "${ASSET}.sha256"
- name: Create GitHub Release
uses: softprops/action-gh-release@v3
env:
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN || github.token }}
with:
tag_name: ${{ steps.meta.outputs.tag }}
name: v${{ steps.meta.outputs.version }}
generate_release_notes: true
files: |
nexior-dist-${{ steps.meta.outputs.safe_tag }}.tar.gz
nexior-dist-${{ steps.meta.outputs.safe_tag }}.tar.gz.sha256