-
Notifications
You must be signed in to change notification settings - Fork 1
68 lines (65 loc) · 2.1 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
61
62
63
64
65
66
67
68
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: 20
- 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: 20
- 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: Build Machine Setup package
run: |
cd packages/machine-setup
yarn neu update
yarn neu build --clean
- name: Create Tar for Machine Setup
run: tar -czvf /tmp/xcpc-tools-machine-setup.tar.gz packages/machine-setup/dist/hydro-xcpctools-machine-setup
- name: Get release version and commit
id: tag
run: |
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
echo "version=$(node -p "require('./packages/server/package.json').version")" >> $GITHUB_OUTPUT
- name: Release
uses: softprops/action-gh-release@v2
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
/tmp/xcpc-tools-machine-setup-app.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}