-
-
Notifications
You must be signed in to change notification settings - Fork 0
114 lines (90 loc) · 2.81 KB
/
main.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
name: Build Executables
on:
release:
types: [published]
permissions: write-all
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install PyInstaller
run: pip install pyinstaller
- name: Build executable for Linux
run: |
pyinstaller --onefile commitify.py
- name: Move Linux executable
run: |
mv dist/commitify ./commitify-linux
- name: List files after build (Linux)
run: |
ls -al
build-windows:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install PyInstaller
run: pip install pyinstaller
- name: Build executable for Windows
run: |
pyinstaller --onefile commitify.py
- name: Move Windows executable
run: |
move dist\commitify.exe commitify.exe # Just rename to commitify.exe
- name: List files after build (Windows)
run: |
dir
build-macos:
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install PyInstaller
run: pip install pyinstaller
- name: Build executable for macOS
run: |
pyinstaller --onefile commitify.py
- name: Move macOS executable
run: |
mv dist/commitify ./commitify # No suffix for macOS
- name: List files after build (macOS)
run: |
ls -al
release:
needs: [build-linux, build-windows, build-macos]
runs-on: ubuntu-latest # This can be any OS since we are just uploading artifacts.
steps:
- name: Checkout code for release job
uses: actions/checkout@v3
# Install GitHub CLI
- name: Install GitHub CLI
run: sudo apt-get install gh # For Ubuntu; adjust for other OS if needed.
# Authenticate with GITHUB_TOKEN
- name: Authenticate with GitHub CLI
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh auth login --with-token <<< "$GITHUB_TOKEN"
# Upload Release Assets using GitHub CLI
- name: Upload Release Assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ github.event.release.tag_name }} \
commitify-linux \
commitify.exe \
commitify \
--clobber # Use --clobber to overwrite existing files if necessary.