Add files via upload #3
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: | |
Windows-amd64: | |
permissions: write-all | |
runs-on: windows-latest | |
name: Build Windows Binary | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Init Python 3.12 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.12' | |
cache: 'pip' | |
- name: Install Dependent Packages | |
run: | | |
python -m pip install --upgrade pip | |
pip install wheel pyinstaller | |
pip install -r requirements.txt | |
shell: pwsh | |
- name: Pyinstaller | |
run: | | |
pyinstaller ticket_for_allcpp.spec | |
shell: pwsh | |
- name: Upload Windows File | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ticket_for_allcpp-windows-amd64 | |
path: dist/ticket_for_allcpp.exe | |
Linux-amd64: | |
permissions: write-all | |
runs-on: ubuntu-latest | |
name: Build Linux Amd64 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Init Python 3.12 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.12' | |
cache: 'pip' | |
- name: Install Dependent Packages | |
run: | | |
python -m pip install --upgrade pip | |
pip install wheel pyinstaller | |
pip install -r requirements.txt | |
- name: Pyinstaller | |
run: | | |
pyinstaller ticket_for_allcpp.spec | |
mv dist/ticket_for_allcpp dist/ticket_for_allcpp-linux-amd64 | |
- name: Upload Linux File | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ticket_for_allcpp-linux-amd64 | |
path: dist/ticket_for_allcpp-linux-amd64 | |
macos-amd64: | |
permissions: write-all | |
runs-on: macOS-latest | |
name: Build macOS Amd64 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Init Python 3.12 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.12' | |
cache: 'pip' | |
- name: Install Dependent Packages | |
run: | | |
python -m pip install --upgrade pip | |
pip install wheel pyinstaller | |
pip install -r requirements.txt | |
- name: Pyinstaller | |
run: | | |
pyinstaller ticket_for_allcpp.spec | |
mv dist/ticket_for_allcpp dist/ticket_for_allcpp-macos-amd64 | |
- name: Upload macOS File | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ticket_for_allcpp-macos-amd64 | |
path: dist/ticket_for_allcpp-macos-amd64 | |
Create-release: | |
permissions: write-all | |
runs-on: ubuntu-latest | |
needs: [ Windows-amd64, Linux-amd64, macos-amd64] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download Artifact | |
uses: actions/download-artifact@v3 | |
- name: get release_informations | |
shell: bash | |
run: | | |
mkdir releases | |
mv ./ticket_for_allcpp-macos-amd64/ticket_for_allcpp-macos-amd64 ./releases/ticket_for_allcpp-macos-amd64 | |
mv ./ticket_for_allcpp-linux-amd64/ticket_for_allcpp-linux-amd64 ./releases/ticket_for_allcpp-linux-amd64 | |
mv ./ticket_for_allcpp-windows-amd64/ticket_for_allcpp.exe ./releases/ticket_for_allcpp-windows-amd64.exe | |
cp config.txt ./releases/config.txt | |
cp cookie.txt ./releases/cookie.txt | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: ${{ github.ref }} | |
draft: false | |
prerelease: false | |
- name: Upload Release Asset | |
uses: dwenegar/upload-release-assets@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
release_id: ${{ steps.create_release.outputs.id }} | |
assets_path: | | |
./releases/ |