ci: test windows build in-place #9
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
env: | |
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }} | |
DISCORD_SERVER_ID: ${{ secrets.DISCORD_SERVER_ID }} | |
timeout-minutes: 2 | |
run: | | |
.\dist\DiscordRoleScraper.exe "$DISCORD_TOKEN" "$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 |