-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (49 loc) · 1.64 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
name: Publish
on:
push:
branches: [ master ]
jobs:
building:
strategy:
matrix:
os: [macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
# Runs when the commit message contains "[Release]" Otherwise it doesn't run
if: "contains(github.event.head_commit.message, '[Release]')"
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: 3.10.0
- name: Preparation
run: |
pip3 install -r requirements.txt
pyinstaller --onefile __main__.py
# Condition to only run this whenever the runner os is Ubuntu
- name: Building Release For Mac
if: matrix.os == 'macos-latest'
run: |
cd ./dist
tar -cf main-macos-x86_64.zip '__main__'
cd ..
# Condition to only run this whenever the runner os is Windows
- name: Building Release For Windows
if: matrix.os == 'windows-latest'
run: |
cd ./dist
tar -cf main-windows-x86_64.zip '__main__.exe'
cd ..
# This will draft a new release & will attach the binaries produced by the above outputs.
# You still need to publish this release though after job ends.
- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: test
name: GitClient
draft: true
files: |
./dist/main-macos-x86_64.zip
./dist/main-windows-x86_64.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # You don't need to add this in secrets it's by default.