Release v1.10.1 #27
Workflow file for this run
This file contains hidden or 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 Executables | |
| run-name: Release ${{ github.ref_name }} | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| jobs: | |
| build-windows: | |
| 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.11' | |
| - name: Install PyInstaller | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install pyinstaller | |
| - name: Build Windows executable | |
| run: | | |
| pyinstaller build.spec | |
| - name: Create zip archive | |
| run: | | |
| cd dist | |
| Compress-Archive -Path "br-equipment-control-app" -DestinationPath "br-equipment-control-app-windows.zip" | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows-build | |
| path: dist/br-equipment-control-app-windows.zip | |
| build-macos: | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install PyInstaller | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install pyinstaller | |
| - name: Build macOS app | |
| run: | | |
| pyinstaller build.spec | |
| - name: Create DMG (optional, requires create-dmg) | |
| run: | | |
| brew install create-dmg | |
| cd dist | |
| create-dmg \ | |
| --volname "br-equipment-control-app" \ | |
| --volicon "../assets/icon.png" \ | |
| --window-pos 200 120 \ | |
| --window-size 800 400 \ | |
| --icon-size 100 \ | |
| --icon "br-equipment-control-app.app" 200 190 \ | |
| --hide-extension "br-equipment-control-app.app" \ | |
| --app-drop-link 600 185 \ | |
| "br-equipment-control-app-macos.dmg" \ | |
| "br-equipment-control-app.app" | |
| continue-on-error: true | |
| - name: Create zip fallback if DMG fails | |
| run: | | |
| cd dist | |
| if [ ! -f "br-equipment-control-app-macos.dmg" ]; then | |
| zip -r "br-equipment-control-app-macos.zip" "br-equipment-control-app.app" | |
| fi | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: macos-build | |
| path: | | |
| dist/br-equipment-control-app-macos.dmg | |
| dist/br-equipment-control-app-macos.zip | |
| build-linux: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y python3-tk | |
| - name: Install PyInstaller | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install pyinstaller | |
| - name: Build Linux executable | |
| run: | | |
| pyinstaller build.spec | |
| - name: Create tar.gz archive | |
| run: | | |
| cd dist | |
| tar -czf br-equipment-control-app-linux.tar.gz br-equipment-control-app/ | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: linux-build | |
| path: dist/br-equipment-control-app-linux.tar.gz | |
| create-release: | |
| needs: [build-windows, build-macos, build-linux] | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/') | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Display structure | |
| run: ls -R artifacts | |
| - name: Extract changelog for this version | |
| id: changelog | |
| run: | | |
| VERSION=${GITHUB_REF#refs/tags/v} | |
| echo "Extracting changelog for version $VERSION" | |
| # Extract the changelog section for this version | |
| CHANGELOG=$(awk -v ver="$VERSION" ' | |
| /^## \[/{ | |
| if ($2 == "["ver"]") { | |
| found=1 | |
| next | |
| } else if (found) { | |
| exit | |
| } | |
| } | |
| found { print } | |
| ' CHANGELOG.md) | |
| # Get previous version tag for comparison | |
| PREV_TAG=$(git tag --sort=-v:refname | grep -v "^v${VERSION}$" | head -n 1) | |
| # Format the changelog | |
| echo "## What's Changed" > release_notes.md | |
| echo "" >> release_notes.md | |
| echo "$CHANGELOG" >> release_notes.md | |
| echo "" >> release_notes.md | |
| echo "**Full Changelog**: https://github.com/${{ github.repository }}/compare/${PREV_TAG}...v${VERSION}" >> release_notes.md | |
| cat release_notes.md | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: | | |
| artifacts/windows-build/br-equipment-control-app-windows.zip | |
| artifacts/macos-build/br-equipment-control-app-macos.dmg | |
| artifacts/macos-build/br-equipment-control-app-macos.zip | |
| artifacts/linux-build/br-equipment-control-app-linux.tar.gz | |
| body_path: release_notes.md | |
| draft: false | |
| prerelease: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |