-
Notifications
You must be signed in to change notification settings - Fork 22
85 lines (69 loc) · 2.76 KB
/
build-and-publish-electron-desktop.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
name: electron desktop
on:
push:
# looks like it works as OR instead of AND
# branches: [ master, testnet ]
tags: [ 'v*.*.*' ]
env:
RELEASE_NAME_master: ""
RELEASE_NAME_testnet: "-testnet"
jobs:
build-electron:
runs-on: macos-latest
steps:
- name: set env BUILD_BRANCH
run: echo "BUILD_BRANCH=$(echo ${{ github.event.base_ref }} | sed 's:refs/heads/::')" >> $GITHUB_ENV
- name: set branch prefix env to be used during docker build, .e.g. "refs/heads/testnet" => ".testnet"
run: echo "BUILD_BRANCH_ENV_PREFIX=$(echo .$BUILD_BRANCH)" >> $GITHUB_ENV
- name: set env BUILD_TAG
run: echo "BUILD_TAG=$(echo $GITHUB_REF | sed 's:refs/tags/::')" >> $GITHUB_ENV
# To build app in 32 bit from a machine with 64 bit
# - name: Install gcc-multilib
# run: |
# sudo apt-get update
# sudo apt-get install --no-install-recommends -y gcc-multilib g++-multilib
# To build app for Windows on Linux
# https://github.com/actions/virtual-environments/issues/743#issuecomment-616349857
# - name: Install Wine
# run: |
# sudo dpkg --add-architecture i386
# wget -qO - https://dl.winehq.org/wine-builds/winehq.key | sudo apt-key add -
# sudo add-apt-repository ppa:cybermax-dexter/sdl2-backport
# sudo apt-add-repository "deb https://dl.winehq.org/wine-builds/ubuntu $(lsb_release -cs) main"
# sudo apt install --install-recommends winehq-stable
# - name: Wine version
# run: wine --version
- uses: actions/checkout@v3
- run: cp .env$BUILD_BRANCH_ENV_PREFIX .env
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '16.x'
cache: 'npm'
- run: npm ci
- name: Cache imagemin
uses: actions/cache@v3
with:
path: tmp/gulp-cache/imagemin
key: gulp-imagemin-${{ hashFiles('node_modules/imagemin-?*/package.json') }}
- name: Build
run: npm run electron:build
# run: npm run electron:build-x64
- name: Release
uses: softprops/action-gh-release@35d938cf01f60fbe522917c81be1e892074f6ad6
# if: startsWith(github.ref, 'refs/tags/')
with:
draft: false
tag_name: ${{ env.BUILD_TAG }}
name: ${{ env.BUILD_TAG }}
files: |
tmp/electron/minter-console-*.dmg
tmp/electron/minter-console-*.snap
tmp/electron/minter-console-*.zip
tmp/electron/minter-console-*.exe
tmp/electron/minter-console-*.AppImage
fail_on_unmatched_files: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: echo GITHUB_HEAD_REF
run: ls tmp/electron