-
-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (94 loc) · 3.36 KB
/
release.yaml
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
on:
push:
tags:
- "v*"
name: Create Release
jobs:
build:
name: Build
strategy:
matrix:
platform: [macos-latest, windows-latest, ubuntu-latest]
runs-on: ${{ matrix.platform }}
env:
GH_TOKEN: ${{secrets.GH_TOKEN}}
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
run: npm ci
- name: Build Client
run: npm run build:client
- name: Build Electron App
run: npm run build:electron
# macos
- name: Build for macos
if: matrix.platform == 'macos-latest'
run: |
npm run build:mac
mv $PWD/build/BookTracker-* ./
- name: Upload macos files
if: matrix.platform == 'macos-latest'
uses: actions/upload-artifact@v4
with:
name: release-macos
path: BookTracker-${{ github.ref_name }}-*
retention-days: 2
# windows
- name: Build for windows (nsis)
if: matrix.platform == 'windows-latest'
run: |
npm run build:nsis
Move-Item -Path "$PWD\build\BookTracker-${{ github.ref_name }}-x64-installer.exe" -Destination "$PWD\BookTracker-${{ github.ref_name }}-x64-installer.exe"
- name: Build for windows (portable)
if: matrix.platform == 'windows-latest'
run: |
npm run build:win
Move-Item -Path "$PWD\build\BookTracker-${{ github.ref_name }}-x64.exe" -Destination "$PWD\BookTracker-${{ github.ref_name }}-x64.exe"
- name: Upload windows files
if: matrix.platform == 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: release-windows
path: BookTracker-${{ github.ref_name }}-*
retention-days: 2
# ubuntu
- name: Build for linux
if: matrix.platform == 'ubuntu-latest'
run: |
npm run build:lnx
mv $PWD/build/BookTracker-* ./
- name: Upload linux files
if: matrix.platform == 'ubuntu-latest'
uses: actions/upload-artifact@v4
with:
name: release-linux
path: BookTracker-${{ github.ref_name }}-*
retention-days: 2
release:
runs-on: ubuntu-latest
needs: build
name: Release
permissions:
contents: write
steps:
- name: Download all release pacakges
uses: actions/download-artifact@v4
id: artifact
with:
path: releases
- name: Create release
id: create_release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
draft: true
prerelease: false
files: |
${{steps.artifact.outputs.download-path}}/release-macos/BookTracker-${{ github.ref_name }}-x64.dmg
${{steps.artifact.outputs.download-path}}/release-windows/BookTracker-${{ github.ref_name }}-x64.exe
${{steps.artifact.outputs.download-path}}/release-windows/BookTracker-${{ github.ref_name }}-x64-installer.exe
${{steps.artifact.outputs.download-path}}/release-linux/BookTracker-${{ github.ref_name }}-amd64.deb
${{steps.artifact.outputs.download-path}}/release-linux/BookTracker-${{ github.ref_name }}-x86_64.rpm
${{steps.artifact.outputs.download-path}}/release-linux/BookTracker-${{ github.ref_name }}-x86_64.AppImage