Release fuckcqooc #20
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: Release fuckcqooc | |
on: | |
push: | |
tags: | |
- '**' | |
workflow_dispatch: | |
jobs: | |
release: | |
runs-on: windows-latest | |
outputs: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
steps: | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GAYHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: 🎉 ${{ github.ref }} | |
draft: true # Release草稿 | |
prerelease: true # 预览版 | |
windowsbuild: | |
name: build windows | |
needs: release | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@master | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.8 | |
- name: install pyinstaller | |
run: | | |
pip3 install pyinstaller # 可替换为自己项目的编译命令 | |
- name: setup env | |
run: | | |
pip install --upgrade pip | |
pip3 install -r requirements.txt | |
- name: build app | |
run: | | |
pyinstaller src/app.py -F -w --add-data "assets;assets" --icon metadata/WinIcon.png | |
- name: build package | |
run: | | |
cd dist | |
ren app.exe fuckcqooc.exe | |
tar -zcvf fuckcqooc_win.tar.gz fuckcqooc.exe | |
- name: upload | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GAYHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.release.outputs.upload_url }} | |
asset_path: dist/fuckcqooc_win.tar.gz # 发布的压缩包名称 | |
asset_name: fuckcqooc_${{ github.ref }}_win.tar.gz # 发布的压缩包名称 | |
asset_content_type: application/gzip | |
macosbuild: | |
name: build macos | |
needs: release | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@master | |
- name: Set up Python | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.8 | |
- name: install pyinstaller | |
run: | | |
pip3 install pyinstaller # 可替换为自己项目的编译命令 | |
- name: setup env | |
run: | | |
pip install --upgrade pip | |
pip3 install -r requirements.txt | |
- name: build app | |
run: | | |
pyinstaller src/app.py -F -w --add-data "assets:assets" --icon metadata/MacIcon.png | |
- name: build package | |
run: | | |
cd dist | |
mv app.app fuckcqooc.app | |
tar -zcvf fuckcqooc_macos.tar.gz fuckcqooc.app | |
- name: upload | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GAYHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.release.outputs.upload_url }} | |
asset_path: dist/fuckcqooc_macos.tar.gz # 发布的压缩包名称 | |
asset_name: fuckcqooc_${{ github.ref }}_macos.tar.gz # 发布的压缩包名称 | |
asset_content_type: application/gzip |