-
Notifications
You must be signed in to change notification settings - Fork 8
152 lines (129 loc) · 4.37 KB
/
Copy pathbuild.yml
File metadata and controls
152 lines (129 loc) · 4.37 KB
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
name: Build Workflow
on:
pull_request:
types: [closed]
jobs:
build_matrix:
strategy:
matrix:
os: [windows-latest, macos-15-intel, ubuntu-latest]
if: github.event.pull_request.merged == true
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Python (MacOS)
if: ${{ matrix.os == 'macos-15-intel' }}
run: |
wget https://www.python.org/ftp/python/3.10.6/python-3.10.6-macos11.pkg
sudo installer -verbose -pkg ./python-3.10.6-macos11.pkg -target /
echo "/Library/Frameworks/Python.framework/Versions/3.10/bin" >> $GITHUB_PATH
- name: Install Python (Windows)
if: ${{ matrix.os == 'windows-latest' }}
uses: actions/setup-python@v5
with:
python-version: '3.10'
architecture: 'x64'
- name: Install Python (Linux)
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: actions/setup-python@v5
with:
python-version: '3.10'
architecture: 'x64'
- name: Install Requirements (MacOS)
if: ${{ matrix.os == 'macos-15-intel' }}
run: |
pip3 install -r requirements.txt
- name: Install Requirements (Windows)
if: ${{ matrix.os == 'windows-latest' }}
run: |
pip install -r requirements.txt
- name: Install Requirements (Linux)
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
pip install -r requirements.txt
- name: Run PyInstaller (MacOS)
if: ${{ matrix.os == 'macos-15-intel' }}
run: |
pyinstaller PySN.py -w --onefile --add-data "Icons/AphIcon.png:." --icon="Icons/AphIcon.icns"
- name: Run PyInstaller (Windows)
if: ${{ matrix.os == 'windows-latest' }}
run: |
pyinstaller PySN.py -w --add-data "Icons/AphIcon.ico;." --icon="Icons/AphIcon.ico"
- name: Run PyInstaller (Linux)
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
pyinstaller PySN.py -w --onefile --add-data "Icons/AphIcon.png:."
- name: Move and Zip (MacOS)
if: ${{ matrix.os == 'macos-15-intel' }}
run: |
mkdir macos
cp dist/PySN macos
(cd macos/ && zip -r -X ../PySN_MacOS.zip .)
- name: Move and Zip (Windows)
if: ${{ matrix.os == 'windows-latest' }}
run: |
mkdir windows
cp -r dist/* windows
Compress-Archive -Path "windows/*" -DestinationPath PySN_Windows.zip
- name: Move and Zip (Linux)
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
mkdir linux
cp dist/PySN linux
(cd linux/ && zip -r -X ../PySN_Linux.zip .)
- name: Upload Artifact (MacOS)
if: ${{ matrix.os == 'macos-15-intel' }}
uses: actions/upload-artifact@v4
with:
name: PySN_MacOS.zip
path: PySN_MacOS.zip
- name: Upload Artifact (Windows)
if: ${{ matrix.os == 'windows-latest' }}
uses: actions/upload-artifact@v4
with:
name: PySN_Windows.zip
path: PySN_Windows.zip
- name: Upload Artifact (Linux)
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: actions/upload-artifact@v4
with:
name: PySN_Linux.zip
path: PySN_Linux.zip
create_release:
needs: build_matrix
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: PySN_MacOS.zip
path: ./artifacts
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: PySN_Windows.zip
path: ./artifacts
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: PySN_Linux.zip
path: ./artifacts
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v2.5.7
name: v2.5.7
body: |
Add window icons to MacOS and Linux.
draft: false
prerelease: false
files: |
./artifacts/PySN_MacOS.zip
./artifacts/PySN_Windows.zip
./artifacts/PySN_Linux.zip