v1.3.3 (alpha) - 24/02/2025 (05:24) #32
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 New Release | |
on: | |
release: | |
types: [published] | |
jobs: | |
handle-new-release: | |
runs-on: ubuntu-24.04 | |
name: Process New Release | |
steps: | |
- name: Log Release Information | |
env: | |
RELEASE_NAME: ${{ github.event.release.name }} | |
RELEASE_TAG: ${{ github.event.release.tag_name }} | |
IS_PRERELEASE: ${{ github.event.release.prerelease }} | |
run: | | |
echo "Release Name: $RELEASE_NAME" | |
echo "Release Tag: $RELEASE_TAG" | |
echo "Is Pre-Release: $IS_PRERELEASE" | |
build: | |
needs: [handle-new-release] | |
runs-on: windows-latest | |
name: Build Windows x64 | |
defaults: | |
run: | |
shell: cmd | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4.2.2 | |
- name: Setup Python for x64 Build | |
uses: actions/setup-python@v5.3.0 | |
with: | |
python-version: 3.x | |
architecture: x64 | |
- name: Create a Python Virtual Environment | |
run: | | |
python -m venv --upgrade-deps "venv" | |
working-directory: .github/workflows | |
- name: Install Python Project Dependencies | |
run: | | |
venv\Scripts\pip install -r "..\..\requirements.txt" | |
venv\Scripts\pip install pyinstaller | |
working-directory: .github/workflows | |
- name: Build with PyInstaller | |
run: | | |
venv\Scripts\pyinstaller "Session_Sniffer.spec" | |
# Output will be in the `dist/` folder | |
working-directory: .github/workflows | |
- name: Upload Build Artifact | |
uses: actions/upload-artifact@v4.5.0 | |
with: | |
name: Session_Sniffer.exe | |
path: .github/workflows/dist/Session_Sniffer.exe | |
upload-release-artifact: | |
needs: [build] | |
runs-on: ubuntu-24.04 | |
name: Upload Release Artifact | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4.2.2 | |
- name: Download Build Artifact | |
uses: actions/download-artifact@v4.1.8 | |
with: | |
path: artifacts | |
name: Session_Sniffer.exe | |
- name: Upload Artifact to Release | |
env: | |
RELEASE_TAG: ${{ github.event.release.tag_name }} | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
echo "Uploading release artifact..." | |
gh release upload "$RELEASE_TAG" \ | |
"artifacts/Session_Sniffer.exe" | |
update-version-info: | |
needs: [upload-release-artifact] | |
runs-on: ubuntu-24.04 | |
name: Update Version Info | |
steps: | |
- name: Checkout Version Branch | |
uses: actions/checkout@v4.2.2 | |
with: | |
ref: version | |
- name: Update Files, Commit, and Push | |
env: | |
IS_PRERELEASE: ${{ github.event.release.prerelease }} | |
RELEASE_NAME: ${{ github.event.release.name }} | |
run: | | |
# Set GitHub Actions bot identity | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
# Set variables for release type (pre-release or stable) and prepare/update | |
if [[ "$IS_PRERELEASE" == "true" ]]; then | |
release_version=$(echo "$RELEASE_NAME" | sed 's/(Alpha) //I') | |
updated_json=$(jq --arg release_version "$release_version" '.Alpha = $release_version' "versions.json") | |
else | |
release_version=$(echo "$RELEASE_NAME" | sed 's/(Stable) //I') | |
updated_json=$(jq --arg release_version "$release_version" '.Stable = $release_version' "versions.json") | |
# For backward compatibility, update the "version.txt" file with the new version (only stores stable releases) | |
echo "$release_version" > "version.txt" | |
git add "version.txt" | |
git commit -m "Update version.txt" | |
fi | |
# Update the "versions.json" file with the new version | |
echo "$updated_json" > "versions.json" | |
git add "versions.json" | |
git commit -m "Update versions.json" | |
# Push Changes | |
git push origin version |