-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (57 loc) · 1.74 KB
/
release.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
name: Build and release
on:
push:
branches:
- main
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- run: yarn
- name: Build
run: yarn build
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- run: yarn
- name: Build
run: yarn build:pkg
- name: Copy Origin Bundle to Dist
run: cp dist/xcpc-tools.js /tmp/xcpc-tools-bundle.js
- name: Create Zip for Windows
run: zip -r /tmp/xcpc-tools-win.zip dist/pkg/xcpc-tools-win.exe
- name: Create Tar for MacOS
run: tar -czvf /tmp/xcpc-tools-macos.tar.gz dist/pkg/xcpc-tools-macos
- name: Create Tar for Linux
run: tar -czvf /tmp/xcpc-tools-linux.tar.gz dist/pkg/xcpc-tools-linux
- name: Get release version and commit
id: tag
run: |
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
echo "::set-output name=version::$(node -p "require('./packages/server/package.json').version")"
- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.tag.outputs.version }}-${{ steps.tag.outputs.sha_short }}
files: |
/tmp/xcpc-tools-bundle.js
/tmp/xcpc-tools-win.zip
/tmp/xcpc-tools-macos.tar.gz
/tmp/xcpc-tools-linux.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}