-
Notifications
You must be signed in to change notification settings - Fork 1
67 lines (58 loc) · 2 KB
/
on_release.yml
File metadata and controls
67 lines (58 loc) · 2 KB
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
name: Build/release
on:
# push:
# branches: [master]
release:
types: [created]
permissions:
contents: write
jobs:
BuildOrRelease:
# the type of machine to run the job on
runs-on: ${{ matrix.os }}
# create a build matrix for jobs
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: ⚙️ Check out Git repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: ⚙️📦️ Build(Linux)
if: matrix.os == 'ubuntu-latest'
# https://www.electron.build/multi-platform-build
run: |
docker run --rm \
--env-file <(env | grep -iE 'DEBUG|NODE_|ELECTRON_|YARN_|NPM_|CI|CIRCLE|TRAVIS_TAG|TRAVIS|TRAVIS_REPO_|TRAVIS_BUILD_|TRAVIS_BRANCH|TRAVIS_PULL_REQUEST_|APPVEYOR_|CSC_|GH_|GITHUB_|BT_|AWS_|STRIP|BUILD_') \
--env ELECTRON_CACHE="/root/.cache/electron" \
--env ELECTRON_BUILDER_CACHE="/root/.cache/electron-builder" \
-v ${PWD}:/project \
-v ${PWD##*/}-node-modules:/project/node_modules \
-v ~/.cache/electron:/root/.cache/electron \
-v ~/.cache/electron-builder:/root/.cache/electron-builder \
electronuserland/builder \
/bin/bash -c "yarn install && yarn icon && yarn run CICD_build"
- name: ⚙️📦️ Build(Windows/MacOS)
if: matrix.os != 'ubuntu-latest'
run: yarn install && yarn icon && yarn run CICD_build
- name: 🌐️ Upload results
uses: actions/upload-artifact@v4
with:
name: binary-${{ matrix.os }}
path: |
dist/*.AppImage
dist/*.pacman
dist/*.deb
dist/*.snap
dist/*.rpm
dist/*.flatpak
dist/*.exe
dist/*.zip
dist/*.dmg
- name: 🚀️ release
uses: softprops/action-gh-release@v2
with:
files: "dist/*"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}