-
Notifications
You must be signed in to change notification settings - Fork 639
80 lines (67 loc) · 2.14 KB
/
build-binaries.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
69
70
71
72
73
74
75
76
77
78
79
80
name: Build binaries for UnblockNeteaseMusic
on:
push:
branches:
- 'enhanced'
paths-ignore:
- '**.md'
- 'precompiled/*.js'
pull_request:
types:
- opened
- synchronize
- reopened
paths-ignore:
- '**.md'
- 'precompiled/*.js'
release:
types:
- published
jobs:
build:
strategy:
matrix:
target:
- 'linux-arm64'
- 'linux-x64'
- 'win-arm64'
- 'win-x64'
fail-fast: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:latest
platforms: all
- name: Install dependencies
run: yarn
- name: Make bundle
run: yarn build
- name: Building executable file for ${{ matrix.target }}
run: |
npx pkg --compress Brotli -t node18-${{ matrix.target }} .
mv "$(ls dist/*)" "$(ls dist/* | sed 's/server/unblockneteasemusic-${{ matrix.target }}/g')"
echo "ASSET_NAME=$(ls dist)" >> $GITHUB_ENV
- name: Publishing to GitHub Artifacts
uses: actions/upload-artifact@v3
if: github.event_name != 'release'
with:
name: ${{ env.ASSET_NAME }}
path: |
./dist/*
- name: Publishing to GitHub Releases
uses: svenstaro/[email protected]
if: github.event_name == 'release'
with:
repo_token: ${{ github.token }}
file: dist/*
tag: ${{ github.ref }}
file_glob: true