Release v1.14.1 #37
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 dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| 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 dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| 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 dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| 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-dist: | |
| needs: [build-windows, build-macos, build-linux] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Create unified dist folder | |
| run: | | |
| mkdir -p dist/windows dist/macos dist/linux | |
| # Copy Windows build | |
| if [ -f artifacts/windows-build/br-equipment-control-app-windows.zip ]; then | |
| cd dist/windows | |
| unzip ../../artifacts/windows-build/br-equipment-control-app-windows.zip | |
| cd ../.. | |
| fi | |
| # Copy macOS build | |
| if [ -f artifacts/macos-build/br-equipment-control-app-macos.dmg ]; then | |
| cp artifacts/macos-build/br-equipment-control-app-macos.dmg dist/macos/ | |
| fi | |
| if [ -f artifacts/macos-build/br-equipment-control-app-macos.zip ]; then | |
| cd dist/macos | |
| unzip ../../artifacts/macos-build/br-equipment-control-app-macos.zip | |
| cd ../.. | |
| fi | |
| # Copy Linux build | |
| if [ -f artifacts/linux-build/br-equipment-control-app-linux.tar.gz ]; then | |
| cd dist/linux | |
| tar -xzf ../../artifacts/linux-build/br-equipment-control-app-linux.tar.gz | |
| cd ../.. | |
| fi | |
| echo "=== Dist folder structure ===" | |
| ls -R dist | |
| - name: Upload unified dist artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist-all-platforms | |
| path: dist/ | |
| - 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 }} | |