forked from asoronow/belljar
-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (68 loc) · 1.97 KB
/
build_electron_app.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
name: Build and Package Electron App
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
version-bump:
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Ensure all tags are fetched
- name: Bump version and push tag
uses: phips28/gh-action-bump-version@master
with:
github-token: ${{ secrets.GH_TOKEN }}
tag-prefix: ''
minor: true # Change this to 'true' for minor, 'false' for patch updates
build:
needs: version-bump
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, macos-latest]
node-version: [18.x]
steps:
- uses: actions/checkout@v4
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm run dist --publish=never
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: ${{ runner.os }}-artifact
path: dist/${{ matrix.os == 'windows-latest' && '**/*.exe' || '**/*.dmg' }}
release:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/download-artifact@v3
with:
name: windows-latest-artifact
path: dist
- uses: actions/download-artifact@v3
with:
name: macos-latest-artifact
path: dist
- run: git fetch --tags
- run: echo "RELEASE_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: dist/*
tag_name: ${{ env.RELEASE_TAG }}
token: ${{ secrets.GH_TOKEN }}