-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (50 loc) · 1.43 KB
/
release.yml
File metadata and controls
60 lines (50 loc) · 1.43 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
name: Build & Release
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
# Define the operating systems to run the job on
# [
# ubuntu-latest,
# macos-latest,
# windows-latest
# ]
os: [ macos-latest, windows-latest ]
steps:
- name: Check out git repository
uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install Dependencies
run: npm install
- name: Update Version From Tag
shell: bash
run: |
# Get the version from the package.json file
PACKAGE_VERSION=$(node -p "require('./package.json').version")
# Check if the package version is different from the tag
if [ "$PACKAGE_VERSION" != "${{ github.ref_name }}" ]; then
echo "Updating version from $PACKAGE_VERSION to ${{ github.ref_name }}"
npm version ${{ github.ref_name }} --no-git-tag-version
else
echo "Version is already up to date."
fi
- name: Build Application
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm run dist
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-build
path: |
dist/*.AppImage
dist/*.dmg
dist/*.exe