feat: 打包方式修改 #150
Workflow file for this run
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: Python Release | |
on: | |
push: | |
tags: | |
- 'v*.*.*' | |
jobs: | |
build: | |
name: Build Executables | |
runs-on: ${{ matrix.config.os.name }} | |
strategy: | |
matrix: | |
config: | |
- os: | |
name: ubuntu-latest | |
filename: Linux | |
end: "" | |
- os: | |
name: macos-14 | |
filename: MacOS_amd64 | |
end: ".app" | |
- os: | |
name: macos-12 | |
filename: MacOS_x64 | |
end: ".app" | |
- os: | |
name: windows-latest | |
filename: Windows | |
end: ".exe" | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.11 | |
cache: 'pip' | |
- name: Upgrade setuptools, wheel, and install requirements | |
run: | | |
pip install --upgrade setuptools wheel pyinstaller && pip install -r requirements.txt | |
- name: Build Pyinstaller | |
run: | | |
pyinstaller main.spec | |
# - name: Zip the Build-windows | |
# if: matrix.config.os.filename == 'Windows' | |
# run: Compress-Archive -Path ./dist/biliTicKerBuy -DestinationPath ${{ secrets.ReleaseZipName }}_${{ matrix.config.os.filename }}-${{github.ref_name}}.zip | |
# | |
# - name: Zip the Build-linux | |
# if: matrix.config.os.filename == 'Linux' | |
# run: zip -r ${{ secrets.ReleaseZipName }}_${{ matrix.config.os.filename }}-${{github.ref_name}}.zip ./dist/biliTickerBuy/* | |
# | |
# | |
# - name: Zip the Build-MacOS | |
# if: matrix.config.os.filename == 'MacOS_amd64' or matrix.config.os.filename == 'MacOS_x64' | |
# run: zip -r ${{ secrets.ReleaseZipName }}_${{ matrix.config.os.filename }}-${{github.ref_name}}.zip ./dist/biliTickerBuy.app/* | |
- name: Upload binaries to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
file: dist/biliTickerBuy${{ matrix.config.os.filename }} | |
asset_name: ${{ secrets.ReleaseZipName }}_${{ matrix.config.os.filename }}_${{ matrix.config.os.filename }} | |
tag: ${{ github.ref }} | |
overwrite: true |