81 lines
2.3 KiB
YAML
81 lines
2.3 KiB
YAML
name: Build and Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest]
|
|
include:
|
|
- os: ubuntu-latest
|
|
artifact_name: fluxer-reaper-linux
|
|
asset_name: fluxer-reaper-linux.zip
|
|
executable_path: dist/fluxer-reaper
|
|
- os: windows-latest
|
|
artifact_name: fluxer-reaper-windows
|
|
asset_name: fluxer-reaper-windows.zip
|
|
executable_path: dist/fluxer-reaper.exe
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.11'
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -r requirements.txt
|
|
pip install pyinstaller
|
|
|
|
- name: Build with PyInstaller
|
|
run: pyinstaller fluxer-reaper.spec
|
|
|
|
- name: Prepare Release Asset (Linux)
|
|
if: matrix.os == 'ubuntu-latest'
|
|
run: |
|
|
chmod +x ${{ matrix.executable_path }}
|
|
mkdir -p ${{ matrix.artifact_name }}
|
|
cp ${{ matrix.executable_path }} ${{ matrix.artifact_name }}/
|
|
zip -r ${{ matrix.asset_name }} ${{ matrix.artifact_name }}
|
|
|
|
- name: Prepare Release Asset (Windows)
|
|
if: matrix.os == 'windows-latest'
|
|
run: |
|
|
mkdir -p ${{ matrix.artifact_name }}
|
|
cp ${{ matrix.executable_path }} ${{ matrix.artifact_name }}/
|
|
powershell Compress-Archive -Path "${{ matrix.artifact_name }}" -DestinationPath "${{ matrix.asset_name }}"
|
|
|
|
- name: Upload Artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{ matrix.artifact_name }}
|
|
path: ${{ matrix.asset_name }}
|
|
|
|
release:
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- name: Download Artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
path: artifacts
|
|
|
|
- name: Create Release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
files: |
|
|
artifacts/fluxer-reaper-linux/fluxer-reaper-linux.zip
|
|
artifacts/fluxer-reaper-windows/fluxer-reaper-windows.zip
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|