-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (74 loc) · 2.45 KB
/
python-package.yml
File metadata and controls
74 lines (74 loc) · 2.45 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
name: Build and Release PTDSolEditor
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
build:
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Clone the repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pygame pyperclip pyinstaller Pillow
- name: Build for Windows
if: runner.os == 'Windows'
run: |
pyinstaller --onefile --windowed --icon=resources/favicon-original.ico `
--add-data "resources/favicon-original.ico;resources" `
sol_viewer.py
mv dist/sol_viewer.exe dist/PTDSolEditor-Windows.exe
- name: Build for Linux
if: runner.os == 'Linux'
run: |
pyinstaller --onefile --windowed --icon=resources/favicon-original.ico \
--add-data "resources/favicon-original.ico:resources" \
sol_viewer.py
mv dist/sol_viewer dist/PTDSolEditor-Linux
- name: Build for macOS
if: runner.os == 'macOS'
run: |
pyinstaller --onefile --windowed --icon=resources/favicon-original.ico \
--add-data "resources/favicon-original.ico:resources" \
sol_viewer.py
mv dist/sol_viewer dist/PTDSolEditor-macOS
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: PTDSolEditor-${{ runner.os }}
path: dist/PTDSolEditor*
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: List files in artifacts directory
run: find artifacts -type f | sort
- name: Create Release
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.GH_TOKEN }}
tag_name: v1.0.${{ github.run_number }}
name: "PTDSolEditor Release v1.0.${{ github.run_number }}"
draft: false
prerelease: false
files: |
artifacts/PTDSolEditor-Windows/PTDSolEditor-Windows.exe
artifacts/PTDSolEditor-Linux/PTDSolEditor-Linux
artifacts/PTDSolEditor-macOS/PTDSolEditor-macOS