-
-
Notifications
You must be signed in to change notification settings - Fork 148
139 lines (136 loc) · 7.1 KB
/
release.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
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
on:
workflow_dispatch:
name: Release Draft
jobs:
get-package-version:
name: Get Package Version
runs-on: ubuntu-22.04
outputs:
version: ${{ steps.version.outputs.PACKAGE_VERSION }}
app_name: ${{ steps.app_name.outputs.APP_NAME }}
fix_app_name: ${{ steps.fix_app_name.outputs.FIX_APP_NAME }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- id: version
run: |
npm i -g json
echo "PACKAGE_VERSION=$(json version -a < package.json)" >> $GITHUB_OUTPUT
- id: app_name
run: |
npm i -g json
echo "APP_NAME=$(json name -a < package.json)" >> $GITHUB_OUTPUT
- id: fix_app_name
# remove 3 from "Keira3"
run: |
npm i -g json
FIX_APP_NAME=$(echo "$(json name -a < package.json)" | sed s/3//g)
echo "FIX_APP_NAME=$FIX_APP_NAME" >> $GITHUB_OUTPUT
build-on-linux:
needs: get-package-version
name: Build and upload the Linux release assets
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build project
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm install
npm run electron:linux
mv "release/${{needs.get-package-version.outputs.app_name}}-${{needs.get-package-version.outputs.version}}.AppImage" ${{needs.get-package-version.outputs.fix_app_name}}-${{needs.get-package-version.outputs.version}}.LINUX.AppImage
mv "release/${{needs.get-package-version.outputs.app_name}}-${{needs.get-package-version.outputs.version}}.x86_64.rpm" ${{needs.get-package-version.outputs.fix_app_name}}-${{needs.get-package-version.outputs.version}}.LINUX.rpm
mv "release/${{needs.get-package-version.outputs.app_name}}_${{needs.get-package-version.outputs.version}}_amd64.deb" ${{needs.get-package-version.outputs.fix_app_name}}-${{needs.get-package-version.outputs.version}}.LINUX.deb
mv "release/${{needs.get-package-version.outputs.app_name}}_${{needs.get-package-version.outputs.version}}_amd64.snap" ${{needs.get-package-version.outputs.fix_app_name}}-${{needs.get-package-version.outputs.version}}.LINUX.snap
zip ${{needs.get-package-version.outputs.fix_app_name}}-${{needs.get-package-version.outputs.version}}.LINUX.AppImage.zip ${{needs.get-package-version.outputs.fix_app_name}}-${{needs.get-package-version.outputs.version}}.LINUX.AppImage
zip ${{needs.get-package-version.outputs.fix_app_name}}-${{needs.get-package-version.outputs.version}}.LINUX.rpm.zip ${{needs.get-package-version.outputs.fix_app_name}}-${{needs.get-package-version.outputs.version}}.LINUX.rpm
zip ${{needs.get-package-version.outputs.fix_app_name}}-${{needs.get-package-version.outputs.version}}.LINUX.deb.zip ${{needs.get-package-version.outputs.fix_app_name}}-${{needs.get-package-version.outputs.version}}.LINUX.deb
zip ${{needs.get-package-version.outputs.fix_app_name}}-${{needs.get-package-version.outputs.version}}.LINUX.snap.zip ${{needs.get-package-version.outputs.fix_app_name}}-${{needs.get-package-version.outputs.version}}.LINUX.snap
rm -rf release
rm -rf *.deb
rm -rf *.rpm
rm -rf *.AppImage
rm -rf *.snap
rm -rf release/*.deb
rm -rf release/*.rpm
rm -rf release/*.AppImage
rm -rf release/*.snap
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{needs.get-package-version.outputs.version}}
release_name: ${{needs.get-package-version.outputs.version}}
draft: true
prerelease: false
files: |
${{needs.get-package-version.outputs.fix_app_name}}-${{needs.get-package-version.outputs.version}}.LINUX.AppImage.zip
${{needs.get-package-version.outputs.fix_app_name}}-${{needs.get-package-version.outputs.version}}.LINUX.rpm.zip
${{needs.get-package-version.outputs.fix_app_name}}-${{needs.get-package-version.outputs.version}}.LINUX.deb.zip
${{needs.get-package-version.outputs.fix_app_name}}-${{needs.get-package-version.outputs.version}}.LINUX.snap.zip
build-on-mac:
needs: get-package-version
name: Build and upload the Mac release assets
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build project
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm install
npm run electron:mac
mv "release/${{needs.get-package-version.outputs.app_name}}-${{needs.get-package-version.outputs.version}}.dmg" ${{needs.get-package-version.outputs.fix_app_name}}-${{needs.get-package-version.outputs.version}}.MAC.dmg
zip ${{needs.get-package-version.outputs.fix_app_name}}-${{needs.get-package-version.outputs.version}}.MAC.dmg.zip ${{needs.get-package-version.outputs.fix_app_name}}-${{needs.get-package-version.outputs.version}}.MAC.dmg
rm -rf release
rm -rf *.yml
rm -rf *.blockmap
rm -rf *.dmg
rm -rf release/*.yml
rm -rf release/*.blockmap
rm -rf release/*.dmg
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{needs.get-package-version.outputs.version}}
release_name: ${{needs.get-package-version.outputs.version}}
draft: true
prerelease: false
files: ${{needs.get-package-version.outputs.fix_app_name}}-${{needs.get-package-version.outputs.version}}.MAC.dmg.zip
build-on-windows:
needs: get-package-version
name: Build and upload the Windows release assets
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build project
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm install;
npm run electron:windows
mv "release/${{needs.get-package-version.outputs.app_name}} ${{needs.get-package-version.outputs.version}}.exe" ${{needs.get-package-version.outputs.fix_app_name}}-${{needs.get-package-version.outputs.version}}.WINDOWS.exe
7z a ${{needs.get-package-version.outputs.fix_app_name}}-${{needs.get-package-version.outputs.version}}.WINDOWS.exe.zip ${{needs.get-package-version.outputs.fix_app_name}}-${{needs.get-package-version.outputs.version}}.WINDOWS.exe
rm -rf release
rm -rf *.exe
rm -rf release/*.exe
shell: bash
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{needs.get-package-version.outputs.version}}
release_name: ${{needs.get-package-version.outputs.version}}
draft: true
prerelease: false
files: ${{needs.get-package-version.outputs.fix_app_name}}-${{needs.get-package-version.outputs.version}}.WINDOWS.exe.zip