Pyinstaller Packing #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Pyinstaller Packing | |
on: | |
push: | |
tags: | |
- "*" | |
workflow_dispatch: | |
jobs: | |
build-go: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
repository: anosora233/mahjong-helper | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: ^1.22 | |
- run: | | |
go build -v | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: mahjong-helper-${{ github.sha }} | |
path: mahjong-helper.exe | |
build-python: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12 | |
- run: | | |
python -m pip install --upgrade pip | |
python -m pip install -r requirements.txt | |
python -m pip install pyinstaller | |
#### | |
pyinstaller --clean mhmp.spec | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: mhmp-pre-${{ github.sha }} | |
path: dist/mhmp | |
pack: | |
runs-on: windows-latest | |
needs: | |
- build-go | |
- build-python | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
path: mhmp | |
merge-multiple: true | |
- run: | | |
mkdir -p mhmp/common/endless | |
mv mhmp/mahjong-helper.exe mhmp/common/endless/ | |
#### | |
curl -Lo proxinject.zip https://github.com/PragmaTwice/proxinject/releases/download/v0.5.0-pre/proxinject-v0.5.0-pre-x64.zip | |
unzip proxinject.zip -o proxinject | |
mv proxinject/release mhmp/common/proxinject | |
#### | |
7z a mhmp-${{ github.ref_name }}-win64.7z mhmp | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: mhmp-${{ github.sha }} | |
path: mhmp-${{ github.ref_name }}-win64.7z | |
- uses: softprops/action-gh-release@v1 | |
if: github.ref_type == 'tag' | |
with: | |
token: ${{ secrets.PAT }} | |
files: mhmp-${{ github.ref_name }}-win64.7z |