-
Notifications
You must be signed in to change notification settings - Fork 2
87 lines (73 loc) · 2.44 KB
/
build.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
81
82
83
84
85
86
87
name: Build
on:
release:
types:
- created
workflow_dispatch:
jobs:
build:
strategy:
fail-fast: false
matrix:
target:
- runs-on: windows-latest
platform: windows
- runs-on: windows-latest
platform: windows
node: 12
- runs-on: ubuntu-latest
platform: linux
- runs-on: ubuntu-latest
platform: linux
emulate: arm64
- runs-on: macos-latest
platform: darwin
runs-on: ${{ matrix.target.runs-on }}
steps:
- name: Set up variables
id: vars
shell: bash
run: |
echo "::set-output name=NODE_VERSION::${{ matrix.target.node || '16' }}"
echo "::set-output name=ARCH::${{ matrix.target.emulate || 'amd64' }}"
- name: Install nix (for arm64)
if: ${{ matrix.target.emulate }}
uses: cachix/install-nix-action@v15
- name: Set up qemu and binfmt (for arm64)
if: ${{ matrix.target.emulate }}
uses: docker/setup-qemu-action@v2
with:
platforms: ${{ matrix.target.emulate }}
- name: Check out
uses: actions/checkout@v3
with:
ref: develop
- name: Set up Node
if: ${{ !matrix.target.emulate }}
uses: actions/setup-node@v2
with:
node-version: ${{ steps.vars.outputs.NODE_VERSION }}
- name: Set up Node (for arm64)
if: ${{ matrix.target.emulate == 'arm64' }}
run: |
nix profile install nixpkgs#nodejs-${{ steps.vars.outputs.NODE_VERSION }}_x --option system aarch64-linux
- name: Install zip (for windows)
if: ${{ matrix.target.platform == 'windows' }}
run: choco install zip
- name: Prepare
run: bash .github/workflows/prepare.sh
- name: Install dependencies
run: |
curl -o $RUNNER_TEMP/yarn.cjs https://repo.yarnpkg.com/3.2.0/packages/yarnpkg-cli/bin/yarn.js
node $RUNNER_TEMP/yarn.cjs install --no-immutable
- name: Pack file
run: bash .github/workflows/pack.sh
- name: Upload asset
shell: bash
run: >
bash .github/workflows/upload.sh
'${{ github.repository }}'
'${{ matrix.target.platform }}-${{ steps.vars.outputs.ARCH }}-node${{ steps.vars.outputs.NODE_VERSION }}'
'${{ toJSON(github.event.release) }}'
env:
TOKEN: ${{ secrets.WORKFLOW_TOKEN }}