Skip to content

git action

git action #9

Workflow file for this run

name: Python Release
on:
push:
tags:
- 'v*.*.*'
jobs:
build:
runs-on: windows-latest # Use a Windows runner
steps:
- name: Checkout source
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.11
- name: Install dependencies
run: |
pip install pyinstaller Pillow
- name: Build Windows Executable
run: |
pyinstaller --onefile --noconsole --add-data="config/cookies.json;config" --add-data="log/log.txt;log" --hidden-import babel.numbers --icon=icon.ico main.py --name bilibili-buy
- name: Debug
run: |
ls -R ./dist
ls -R ./dist/bilibili-buy
- name: Zip the Build
run: zip -r ${{ secrets.ReleaseZipName }} ./dist/bilibili-buy
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: TODO New Release.
draft: false
prerelease: false
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{ secrets.ReleaseZipName }}.zip
asset_name: ${{ secrets.ReleaseZipName }}.zip
asset_content_type: application/zip