disco-reaper/.github/workflows/release.yml
2026-03-05 18:07:29 +05:30

88 lines
2.5 KiB
YAML

name: Build and Release
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- os: ubuntu-latest
artifact_name: disco-reaper-linux
asset_name: disco-reaper-linux.zip
executable_path: dist/DiscoReaper
- os: windows-latest
artifact_name: disco-reaper-windows
asset_name: disco-reaper-windows.zip
executable_path: dist/DiscoReaper.exe
- os: macos-latest
artifact_name: disco-reaper-macos
asset_name: disco-reaper-macos.zip
executable_path: dist/DiscoReaper
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 Pillow
- name: Build with PyInstaller
run: |
echo "Listing directory contents:"
ls -R || dir /s
pyinstaller disco-reaper.spec
- name: Prepare Release Asset (Linux/MacOS)
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
run: |
cp ${{ matrix.executable_path }} DiscoReaper
chmod +x DiscoReaper
zip ${{ matrix.asset_name }} DiscoReaper
- name: Prepare Release Asset (Windows)
if: matrix.os == 'windows-latest'
run: |
copy ${{ matrix.executable_path }} DiscoReaper.exe
powershell Compress-Archive -Path "DiscoReaper.exe" -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/disco-reaper-linux/disco-reaper-linux.zip
artifacts/disco-reaper-windows/disco-reaper-windows.zip
artifacts/disco-reaper-macos/disco-reaper-macos.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}