-
Notifications
You must be signed in to change notification settings - Fork 1
189 lines (154 loc) · 5.09 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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
name: Release
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
create-release:
runs-on: ubuntu-20.04
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: "v${{ github.run_number }}"
release_name: Release ${{ github.run_number }}
draft: false
prerelease: false
body: "Description of the release goes here"
- name: Set Outputs
id: set_outputs
run: |
echo "upload_url=${{ steps.create_release.outputs.upload_url }}" >> $GITHUB_ENV
electron-release:
needs: create-release
runs-on: ubuntu-20.04
defaults:
run:
working-directory: ./electron-app
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: "20" # Specify the Node.js version based on your requirements
- name: Install dependencies
run: npm install
- name: Build and Publish
run: npm run release
- name: Get Release Asset Path
id: get_asset_path
run: |
asset_path=$(find ./dist -type f -name '*.AppImage')
echo "asset_path=$asset_path" >> $GITHUB_ENV
echo "asset_name=$(basename $asset_path)" >> $GITHUB_ENV
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: ./electron-app/dist/${{ env.asset_name }} # Uses the dynamically found file path
asset_name: ${{ env.asset_name }} # Uses the dynamically set asset name
asset_content_type: application/octet-stream
installer-release:
needs: create-release
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install Nuitka
run: |
python -m pip install --upgrade pip
python -m pip install requests
python -m pip install nuitka
- name: Build Standalone Installer
run: |
python -m nuitka installer.py --standalone --onefile
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: ./installer.bin
asset_name: installer.bin
asset_content_type: application/octet-stream
electron-release-win:
needs: create-release
runs-on: windows-latest
defaults:
run:
working-directory: ./electron-app
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "20"
- name: Install dependencies
run: npm install
- name: Build and Package for Windows
run: npm run release
- name: Get Release Asset Path
id: get_asset_path
run: |
asset_path=$(find ./dist -type f -name '*.zip')
echo "asset_path=$asset_path" >> $GITHUB_ENV
echo "asset_name=$(basename $asset_path)" >> $GITHUB_ENV
shell: bash
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: ./electron-app/dist/${{ env.asset_name }}
asset_name: ${{ env.asset_name }}
asset_content_type: application/zip
installer-release-win:
needs: create-release
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install Nuitka
run: |
python -m pip install --upgrade pip
python -m pip install cx_freeze requests tqdm
- name: Build Standalone Installer
env:
NUITKA_DOWNLOADS: yes
run: |
cxfreeze --script installer.py --target-dir dist
- name: Zip the output
run: |
powershell Compress-Archive -Path "dist\*" -DestinationPath "installer-win.zip"
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: ./installer-win.zip
asset_name: installer-win.zip
asset_content_type: application/octet-stream