mirror of
https://github.com/hyb-oyqq/FRAISEMOE-Addons-Installer-NEXT.git
synced 2026-01-30 17:54:30 +00:00
66 lines
1.8 KiB
YAML
66 lines
1.8 KiB
YAML
name: Build and Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- '*' # 任意 tag 都会触发构建
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.11'
|
|
cache: 'pip'
|
|
cache-dependency-path: 'source/requirements.txt'
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -r source/requirements.txt
|
|
|
|
- name: Get version from tag
|
|
id: get_version
|
|
run: |
|
|
$version = "${{ github.ref_name }}"
|
|
echo "VERSION=$version" >> $env:GITHUB_OUTPUT
|
|
|
|
- name: Verify icon file
|
|
run: |
|
|
cd source
|
|
if (Test-Path "assets/images/ICO/icon.ico") {
|
|
Write-Host "Icon file found"
|
|
Get-Item "assets/images/ICO/icon.ico"
|
|
} else {
|
|
Write-Host "Icon file NOT found!"
|
|
exit 1
|
|
}
|
|
|
|
- name: Build with PyInstaller
|
|
run: |
|
|
cd source
|
|
pyinstaller --noconfirm build.spec
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: release-${{ steps.get_version.outputs.VERSION }}
|
|
path: source/dist/FRAISEMOE_Addons_Installer_NEXT.exe
|
|
|
|
- name: Create Release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
name: release-${{ steps.get_version.outputs.VERSION }}
|
|
files: source/dist/FRAISEMOE_Addons_Installer_NEXT.exe
|
|
draft: false
|
|
prerelease: false
|
|
generate_release_notes: true
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|