This repository has been archived by the owner on Mar 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (83 loc) · 2.9 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
88
89
90
91
name: Build
on:
release:
types: ['created']
pull_request:
push:
# tags-ignore:
# - 'v*'
paths-ignore:
- '.github/**'
- "*.md"
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
# macos-11.0 ?
os: [macos-latest , ubuntu-latest, windows-latest]
arch: [x64, arm64]
# arch: [ia32, armv7l, x64, arm64, mips64el]
include:
- os: ubuntu-latest
arch: armv7l
experimental: true
fail-fast: false
steps:
- name: Check out Git repository
uses: actions/checkout@v1
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v1
with:
node-version: 14
- 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 }}-${{ matrix.arch }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Build Electron app
env:
TARGET_ARCH: ${{ matrix.arch }}
run: |
npm install
npm run lint
npm run make -- --arch ${{ matrix.arch }}
- name: nodejs project information
id: projectinfo
uses: gregoranders/nodejs-project-info@v0.0.12
#- run: |
# find out
#- run: |
# npx renamer --find ".exe" --replace "-${{ matrix.arch }}.exe" "out/**"
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
#- uses: AButler/upload-release-assets@v2.0
# if: ${{ startsWith(github.ref, 'refs/tags/v') }}
# with:
# files: "out/make/**/*.{exe,rpm,deb,dmg,zip}"
# repo-token: ${{ secrets.GITHUB_TOKEN }}
# release-tag: ${{ steps.get_version.outputs.VERSION }}
- name: Upload release binaries
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
uses: alexellis/upload-assets@0.2.2
env:
GITHUB_TOKEN: ${{ github.token }}
with:
asset_paths: '["out/make/squirrel.windows/${{ matrix.arch }}/*.exe","out/make/rpm/${{ matrix.arch }}/*.rpm","out/make/deb/${{ matrix.arch }}/*.deb", "out/make/*.dmg","out/make/zip/darwin/${{ matrix.arch }}/*.zip"]'
- uses: actions/upload-artifact@v2
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
with:
name: ${{ steps.projectinfo.outputs.name }}-${{ steps.projectinfo.outputs.version }}-${{ runner.os }}-${{ matrix.arch }}
path: |
out/make/**/*.exe
out/make/rpm/${{ matrix.arch }}/*.rpm
out/make/deb/${{ matrix.arch }}/*.deb
out/make/**/*.dmg
out/make/**/*.zip
# out/make/**/${{ matrix.arch }}/*