Skip to content

Build, Test, & Publish Windows Release with PyInstaller #10

Build, Test, & Publish Windows Release with PyInstaller

Build, Test, & Publish Windows Release with PyInstaller #10

Workflow file for this run

name: Build, Test, & Publish Windows Release with PyInstaller
on:
push:
tags:
- 'v*'
jobs:
build:
name: Build Windows Release
runs-on: windows-latest
environment: discord_live_testing
if: ${{ !github.event.act }}
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11.0'
- name: Install PyInstaller & Script Dependencies
run: |
pip install -U pyinstaller
pip install -r requirements.txt
- name: Build with PyInstaller
run: pyinstaller main.py --onefile --name DiscordRoleScraper
- name: Test Build
shell: pwsh
env:
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
DISCORD_SERVER_ID: ${{ secrets.DISCORD_SERVER_ID }}
timeout-minutes: 2
run: |
.\dist\DiscordRoleScraper.exe "env:DISCORD_TOKEN" "env:DISCORD_SERVER_ID" true
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: windows-release
path: |
dist/DiscordRoleScraper.exe
config.toml
release:
name: Zip & Upload Release
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
steps:
- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: windows-release
- name: Zip Files
run: |
mv dist/DiscordRoleScraper.exe .
zip -r windows-release.zip DiscordRoleScraper.exe config.toml
- name: Create Release with Zipped Build
uses: softprops/action-gh-release@v2
with:
files: windows-release.zip