-
Notifications
You must be signed in to change notification settings - Fork 11
72 lines (61 loc) · 2.19 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
name: Build/release
on:
push:
tags:
- '*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Clone Repo
uses: actions/checkout@v1
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v1
with:
node-version: 15
- name: Install Wine
run: |
sudo dpkg --add-architecture i386
wget -nc https://dl.winehq.org/wine-builds/winehq.key
sudo apt-key add winehq.key
sudo add-apt-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ focal main'
sudo apt update
sudo apt install --install-recommends winehq-stable
- name: Install Deps
run: npm install
- name: Build Electron App
run: npm run electron:build -- --win --publish=never
- name: Get Tag
id: get_tag
if: startsWith(github.ref, 'refs/tags/')
run: |
echo ${GITHUB_REF/refs\/tags\//}
echo ::set-output name=TAG::${GITHUB_REF/refs\/tags\//}
- name: Get Name of Artifact
id: get_artifact_name
run: |
ARTIFACT_PATHNAME=$(ls dist_electron/*.exe | head -n 1)
ARTIFACT_NAME=$(basename $ARTIFACT_PATHNAME)
echo ::set-output name=ARTIFACT_NAME::${ARTIFACT_NAME}
echo ::set-output name=ARTIFACT_PATHNAME::${ARTIFACT_PATHNAME}
- name: Create Release
id: create_release
uses: actions/create-release@latest
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.get_tag.outputs.TAG }}
release_name: ${{ steps.get_tag.outputs.TAG }}
draft: false
prerelease: false
- name: Upload exe to Release
uses: actions/upload-release-asset@v1
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ steps.get_artifact_name.outputs.ARTIFACT_PATHNAME }}
asset_name: ${{ steps.get_artifact_name.outputs.ARTIFACT_NAME }}
asset_content_type: application/octet-stream