-
Notifications
You must be signed in to change notification settings - Fork 43
66 lines (63 loc) · 2.35 KB
/
release-drafter.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
name: Create Release And Upload assets
on:
push:
tags:
- 'v*'
jobs:
create-release:
name: Create Release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get version
id: get_version
run: |
TAG=$(basename ${GITHUB_REF})
echo "{TAG}={$TAG}" >> $GITHUB_OUTPUT
- name: Create Release
id: create_release
uses: release-drafter/release-drafter@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
config-name: release-config.yml
version: ${{ steps.get_version.outputs.TAG }}
tag: ${{ steps.get_version.outputs.TAG }}
- name: Extract repository name
run: echo "REPO=$(basename ${{ github.repository }})" >> $GITHUB_ENV
- name: Remove 'v' prefix from tag
run: echo "TAG=$(echo ${{ steps.get_version.outputs.TAG }} | sed 's/^v//')" >> $GITHUB_ENV
- name: Install Nodejs
uses: actions/setup-node@v4
with:
node-version: 22
- uses: pnpm/action-setup@v3
name: Install pnpm
id: pnpm-install
with:
version: 9
run_install: false
- name: Build web
run: |
sed -i "s@\"Version\": .*@\"Version\": \"${{ env.TAG }}\",@" public/platform-config.json
sed -i "s@\"version\": .*@\"version\": \"${{ env.TAG }}\",@" package.json
pnpm install --frozen-lockfile
pnpm build
- name: Create Upload Assets
run: |
mv dist ${{ env.REPO }}-${{ steps.get_version.outputs.TAG }}
tar -czf ${{ env.REPO }}-${{ steps.get_version.outputs.TAG }}.tar.gz ${{ env.REPO }}-${{ steps.get_version.outputs.TAG }}
echo $(md5sum ${{ env.REPO }}-${{ steps.get_version.outputs.TAG }}.tar.gz | awk '{print $1}') > ${{ env.REPO }}-${{ steps.get_version.outputs.TAG }}.tar.gz.md5
- name: Release Upload Assets
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
files: |
${{ env.REPO }}-${{ steps.get_version.outputs.TAG }}.tar.gz
${{ env.REPO }}-${{ steps.get_version.outputs.TAG }}.tar.gz.md5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}