2025-01-06 01:26:03 +08:00

61 lines
1.4 KiB
YAML

name: Build Executable
on:
workflow_run:
workflows: ["Python Package"]
types:
- completed
branches:
- "main"
jobs:
build:
# Only run if the python-publish workflow succeeded
if: ${{ github.event.workflow_run.conclusion == 'success' }}
strategy:
fail-fast: false
matrix:
target:
- os: windows-2022
triple: x86_64-pc-windows-msvc
- os: ubuntu-22.04
triple: x86_64-unknown-linux-gnu
- os: macos-12
triple: x86_64-apple-darwin
runs-on: ${{ matrix.target.os }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: olegtarasov/get-tag@v2.1.4
id: get_tag_name
with:
tagRegex: "v(?<version>.*)"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: pip
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install nox
- name: Build exe
run: |
nox -s build-exe -- --release --version ${{ steps.get_tag_name.outputs.version }}
- uses: ncipollo/release-action@v1
with:
allowUpdates: true
updateOnlyUnreleased: false
omitBody: true
artifacts: ".zip/*.zip"
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}