-
-
Notifications
You must be signed in to change notification settings - Fork 16
84 lines (71 loc) · 2.24 KB
/
main.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
name: Build
on: [push, pull_request]
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-13, macos-14]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '18.17.1'
registry-url: 'https://registry.npmjs.org'
- name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v2
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Windows build
if: ${{ matrix.os == 'windows-latest' }}
shell: cmd
run: |
call .\app\script\build.bat
- name: Linux build
if: ${{ matrix.os == 'ubuntu-latest' }}
shell: bash
run: |
chmod +x ./app/script/build.sh
./app/script/build.sh
- name: macOS build
if: ${{ contains(matrix.os, 'macos') }}
shell: bash
run: |
chmod +x ./app/script/build.sh
./app/script/build.sh
- name: Get assets
if: ${{ startsWith(github.event.ref, 'refs/tags') }}
run: cd app&&npm run get&&cd ..
env:
MISHIRO_NO_PROGRESS: '1'
- name: Pack x64
if: ${{ startsWith(github.event.ref, 'refs/tags') && matrix.os != 'macos-14' }}
run: cd app&&npm run pack:x64&&cd ..
- name: Pack ia32
if: ${{ startsWith(github.event.ref, 'refs/tags') && matrix.os == 'windows-latest' }}
run: cd app&&npm run pack:ia32&&cd ..
- name: Pack arm64
if: ${{ startsWith(github.event.ref, 'refs/tags') && matrix.os == 'macos-14' }}
run: cd app&&npm run pack:arm64&&cd ..
- name: Create release
if: ${{ startsWith(github.event.ref, 'refs/tags') }}
uses: toyobayashi/upload-release-assets@v3.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.after }}
release_name: ${{ github.event.after }}
draft: true
prerelease: false
assets: |
./dist/*.zip
./dist/*.deb
./dist/*.exe