feat(localization): add verified package fallback #16
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: Release | |
| on: | |
| workflow_dispatch: | |
| push: | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: read | |
| jobs: | |
| build-windows: | |
| name: Build Windows x64 | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.12" | |
| architecture: x64 | |
| - name: Build packages | |
| run: .\build-portable.ps1 | |
| - name: Run unit tests | |
| run: .\build\.venv\Scripts\python.exe -m unittest discover -s tests -v | |
| - name: Upload Windows artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: rmtool-windows-x64 | |
| path: | | |
| dist/rmtool-windows-x64.zip | |
| dist/rmtool-windows-x64-onefile.exe | |
| if-no-files-found: error | |
| build-macos: | |
| name: Build macOS ARM64 | |
| runs-on: macos-15 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.12" | |
| architecture: arm64 | |
| - name: Install dependencies | |
| run: | | |
| python -m venv --clear build/.venv | |
| build/.venv/bin/python -m pip --isolated install --disable-pip-version-check --no-input --requirement requirements.txt "PyInstaller==6.21.0" | |
| build/.venv/bin/python -m pip check | |
| - name: Run unit tests | |
| env: | |
| QT_QPA_PLATFORM: offscreen | |
| run: build/.venv/bin/python -m unittest discover -s tests -v | |
| - name: Generate app icon | |
| run: | | |
| iconset=build/rmtool.iconset | |
| mkdir -p "$iconset" | |
| for size in 16 32 128 256 512; do | |
| sips -z "$size" "$size" assets/rmtool-icon.png --out "$iconset/icon_${size}x${size}.png" | |
| retina=$((size * 2)) | |
| sips -z "$retina" "$retina" assets/rmtool-icon.png --out "$iconset/icon_${size}x${size}@2x.png" | |
| done | |
| iconutil -c icns "$iconset" -o build/rmtool.icns | |
| - name: Build and package app | |
| run: | | |
| root=$PWD | |
| build/.venv/bin/python -m PyInstaller \ | |
| --clean \ | |
| --noconfirm \ | |
| --windowed \ | |
| --onedir \ | |
| --name rmtool \ | |
| --icon "$root/build/rmtool.icns" \ | |
| --add-data "$root/assets/fonts:assets/fonts" \ | |
| --add-data "$root/assets/device_frames:assets/device_frames" \ | |
| --distpath dist \ | |
| --workpath build/macos \ | |
| --specpath build \ | |
| "$root/rmtool.py" | |
| test -d dist/rmtool.app | |
| ditto -c -k --sequesterRsrc --keepParent dist/rmtool.app dist/rmtool-macos-arm64.app.zip | |
| - name: Upload macOS artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: rmtool-macos-arm64 | |
| path: dist/rmtool-macos-arm64.app.zip | |
| if-no-files-found: error | |
| release: | |
| name: Publish GitHub Release | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
| permissions: | |
| contents: write | |
| needs: | |
| - build-windows | |
| - build-macos | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| path: dist | |
| merge-multiple: true | |
| - name: Publish release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| GH_REPO: ${{ github.repository }} | |
| run: | | |
| notes_file="docs/releases/${GITHUB_REF_NAME}.md" | |
| if [[ -f "$notes_file" ]]; then | |
| notes_args=(--notes-file "$notes_file") | |
| else | |
| notes_args=(--generate-notes) | |
| fi | |
| gh release create "$GITHUB_REF_NAME" \ | |
| dist/rmtool-windows-x64.zip \ | |
| dist/rmtool-windows-x64-onefile.exe \ | |
| dist/rmtool-macos-arm64.app.zip \ | |
| --verify-tag \ | |
| "${notes_args[@]}" |