-
Notifications
You must be signed in to change notification settings - Fork 7
82 lines (78 loc) · 2.71 KB
/
python-pyinstaller.yml
File metadata and controls
82 lines (78 loc) · 2.71 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
# pyinstaller --console --one-file .\sourcehold\__main__.py
name: Python pyinstaller
on:
workflow_dispatch: {}
push:
branches: [ master ]
jobs:
build_pyinstaller:
permissions:
contents: write
runs-on: ${{ matrix.os }}
strategy:
matrix:
# os: [ubuntu-latest, windows-latest, macOS-latest]
os: [windows-latest]
platform: [x86]
python-version: ['3.13']
python-platform: [x86]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.python-platform }}
- name: Enable Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1.4.1
with:
arch: ${{ matrix.python-platform }}
if: matrix.os == 'windows-latest'
- name: Install dependencies
shell: bash
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade wheel setuptools Cython
pip install flake8 pytest
pip install -r requirements.txt
- name: Run pyinstaller
shell: bash
run: |
python -m pip install pyinstaller
pyinstaller --console --onefile ./sourcehold/__main__.py --name sourcehold
- name: Ensure special latest release exists
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
# Set continue on error to true
set +e
if [[ "$(gh --repo sourcehold/sourcehold-maps release view latest 2>&1)" == "release not found" ]]; then
set -e
gh --repo sourcehold/sourcehold-maps release create latest --latest
fi
- name: Upload pyinstaller to special latest release
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
gh --repo sourcehold/sourcehold-maps release upload latest dist/sourcehold* --clobber
- name: Ensure release exists
if: github.ref_type == 'tag'
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
# Set continue on error to true
set +e
if [[ "$(gh --repo sourcehold/sourcehold-maps release view ${{ github.ref_name }} 2>&1)" == "release not found" ]]; then
set -e
gh --repo sourcehold/sourcehold-maps release create ${{ github.ref_name }} --latest
fi
- name: Upload pyinstaller to release
if: github.ref_type == 'tag'
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
gh --repo sourcehold/sourcehold-maps release upload ${{ github.ref_name }} dist/sourcehold*