Pyinstaller Packing #12
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@v4 | |
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: dsaltares/fetch-gh-release-asset@master | |
with: | |
repo: PragmaTwice/proxinject | |
version: tags/v0.5.0-pre | |
file: proxinject-v0.5.0-pre-x64.zip | |
target: downloads/ | |
- uses: actions/download-artifact@v4 | |
with: | |
path: artifacts | |
merge-multiple: true | |
- run: | | |
mv artifacts/mhmp-pre mhmp | |
#### | |
unzip downloads/proxinject-v0.5.0-pre-x64.zip -o proxinject | |
mv proxinject/release mhmp/common/proxinject | |
#### | |
mkdir -p mhmp/common/endless | |
mv artifacts/mahjong-helper.exe mhmp/common/endless/ | |
#### | |
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 |