-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease_pyinstaller_binaries.yml
More file actions
95 lines (80 loc) · 2.51 KB
/
Copy pathrelease_pyinstaller_binaries.yml
File metadata and controls
95 lines (80 loc) · 2.51 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
name: Build PyInstaller Binaries
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
python-version: "3.10"
target: linux
extension: ""
- os: windows-latest
python-version: "3.10"
target: windows
extension: ".exe"
- os: macos-latest
python-version: "3.10"
target: macos
extension: ""
- os: macos-26-intel
python-version: "3.10"
target: macos-intel
extension: ""
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
python -m pip install . pyinstaller
- name: Build executable with PyInstaller
shell: bash
run: |
BINARY_NAME="gc-content-${{ matrix.target }}"
OUTPUT_NAME="${BINARY_NAME}${{ matrix.extension }}"
pyinstaller --onefile --name "${BINARY_NAME}" src/gc_content/gc_content.py
mkdir -p release
cp "dist/${OUTPUT_NAME}" "release/${OUTPUT_NAME}"
python - <<PY
import hashlib
from pathlib import Path
output_name = "${OUTPUT_NAME}"
binary_path = Path("release") / output_name
digest = hashlib.sha256(binary_path.read_bytes()).hexdigest()
checksum_path = binary_path.with_name(f"{output_name}.sha256")
checksum_path.write_text(f"{digest} {output_name}\n", encoding="utf-8")
PY
- name: Upload executable artifact
uses: actions/upload-artifact@v5
with:
name: pyinstaller-${{ matrix.target }}
path: release/*
publish-release-assets:
name: Upload binaries to GitHub release
needs:
- build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
permissions:
contents: write
steps:
- name: Download all executable artifacts
uses: actions/download-artifact@v6
with:
pattern: pyinstaller-*
merge-multiple: true
path: release-assets/
- name: Attach executables to release
uses: softprops/action-gh-release@v2
with:
files: release-assets/*
tag_name: ${{ github.ref_name }}