Build and Release #1
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 and Release | |
on: | |
workflow_dispatch: | |
inputs: | |
tag_name: | |
description: "Tag for the release" | |
required: true | |
default: "v1.0.0" | |
permissions: | |
contents: write | |
actions: read | |
id-token: none | |
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.12.5" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Install PyInstaller | |
run: pip install pyinstaller | |
- name: Package Application | |
run: | | |
pyinstaller --noconfirm --onefile --icon "src\img\icon.ico" --name "CS2.Bhop" --version-file "version.txt" "main.py" | |
- name: Upload Build Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: CS2_Bhop | |
path: dist/CS2.Bhop.exe | |
release: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Download Build Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: CS2_Bhop | |
path: ./artifact-download | |
- name: Verify Downloaded Artifact | |
run: | | |
echo "Listing artifact-download directory:" | |
ls -la ./artifact-download | |
if [ ! -f ./artifact-download/CS2.Bhop.exe ]; then | |
echo "Error: File CS2.Bhop.exe not found in artifact-download directory!" | |
exit 1 | |
fi | |
- name: Create release | |
uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.event.inputs.tag_name }} | |
name: CS2 Bhop - Release ${{ github.event.inputs.tag_name }} | |
body_path: ./ChangeLog.md | |
files: | | |
./artifact-download/CS2.Bhop.exe |