Fix WiX configuration: place WixVariable after Package element #140
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 | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| release: | |
| types: [created, published] | |
| workflow_dispatch: | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| # Cross-platform compilation check (runs on every push/PR) | |
| cross-platform-check: | |
| name: Cross-Platform Build Check | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Install Linux dependencies | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libgtk-3-dev libsqlite3-dev libglib2.0-dev libasound2-dev libxdo-dev libappindicator3-dev pkg-config | |
| - name: Cache cargo | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-cargo-check-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Check compilation | |
| run: cargo check --all-features --verbose | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libgtk-3-dev libsqlite3-dev libglib2.0-dev libasound2-dev libxdo-dev libappindicator3-dev pkg-config | |
| - name: Cache cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cargo/registry | |
| key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Cache cargo index | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cargo/git | |
| key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Cache target directory | |
| uses: actions/cache@v4 | |
| with: | |
| path: target | |
| key: ${{ runner.os }}-target-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Run tests | |
| run: cargo test --all-features | |
| build-linux: | |
| name: Build Linux | |
| runs-on: ubuntu-latest | |
| needs: test | |
| if: github.event_name == 'release' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libgtk-3-dev libsqlite3-dev libglib2.0-dev libasound2-dev libxdo-dev libappindicator3-dev pkg-config libfuse2 | |
| - name: Cache cargo | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Build release | |
| run: cargo build --release --verbose | |
| - name: Create tar.gz archive | |
| run: | | |
| cd target/release | |
| tar -czf aaeq-linux-x64.tar.gz aaeq | |
| - name: Download linuxdeploy and plugins | |
| run: | | |
| wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage | |
| wget https://raw.githubusercontent.com/linuxdeploy/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh | |
| chmod +x linuxdeploy-x86_64.AppImage | |
| chmod +x linuxdeploy-plugin-gtk.sh | |
| - name: Create AppImage | |
| continue-on-error: true | |
| run: | | |
| # Create AppDir structure | |
| mkdir -p AppDir/usr/bin | |
| mkdir -p AppDir/usr/share/applications | |
| mkdir -p AppDir/usr/share/icons/hicolor/256x256/apps | |
| # Copy binary | |
| cp target/release/aaeq AppDir/usr/bin/ | |
| # Copy desktop file and icon | |
| cp aaeq.desktop AppDir/usr/share/applications/ | |
| cp aaeq-icon.png AppDir/usr/share/icons/hicolor/256x256/apps/aaeq.png | |
| # Set environment for linuxdeploy | |
| export DEPLOY_GTK_VERSION=3 | |
| export OUTPUT=aaeq-linux-x64.AppImage | |
| # Create AppImage | |
| ./linuxdeploy-x86_64.AppImage \ | |
| --appdir AppDir \ | |
| --plugin gtk \ | |
| --output appimage \ | |
| --desktop-file AppDir/usr/share/applications/aaeq.desktop \ | |
| --icon-file AppDir/usr/share/icons/hicolor/256x256/apps/aaeq.png | |
| - name: Upload tar.gz artifact | |
| if: success() || failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: aaeq-linux-x64-tarball | |
| path: target/release/aaeq-linux-x64.tar.gz | |
| - name: Upload AppImage artifact | |
| if: success() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: aaeq-linux-x64-appimage | |
| path: aaeq-linux-x64.AppImage | |
| if-no-files-found: warn | |
| build-linux-arm64: | |
| name: Build Linux ARM64 | |
| runs-on: ubuntu-latest | |
| needs: test | |
| continue-on-error: true | |
| if: github.event_name == 'release' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: aarch64-unknown-linux-gnu | |
| - name: Install ARM64 cross-compilation toolchain | |
| run: | | |
| sudo dpkg --add-architecture arm64 | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| gcc-aarch64-linux-gnu \ | |
| g++-aarch64-linux-gnu \ | |
| pkg-config \ | |
| libssl-dev:arm64 \ | |
| libgtk-3-dev:arm64 \ | |
| libsqlite3-dev:arm64 \ | |
| libglib2.0-dev:arm64 \ | |
| libasound2-dev:arm64 \ | |
| libxdo-dev:arm64 \ | |
| libappindicator3-dev:arm64 | |
| - name: Cache cargo | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-arm64-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Build release for ARM64 | |
| env: | |
| CC_aarch64_unknown_linux_gnu: aarch64-linux-gnu-gcc | |
| CXX_aarch64_unknown_linux_gnu: aarch64-linux-gnu-g++ | |
| PKG_CONFIG_ALLOW_CROSS: "1" | |
| PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig:/usr/share/pkgconfig | |
| PKG_CONFIG_SYSROOT_DIR: / | |
| run: cargo build --release --target aarch64-unknown-linux-gnu --verbose | |
| - name: Create archive | |
| run: | | |
| cd target/aarch64-unknown-linux-gnu/release | |
| tar -czf aaeq-linux-arm64.tar.gz aaeq | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: aaeq-linux-arm64 | |
| path: target/aarch64-unknown-linux-gnu/release/aaeq-linux-arm64.tar.gz | |
| build-macos: | |
| name: Build macOS | |
| runs-on: macos-latest | |
| needs: test | |
| if: github.event_name == 'release' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: x86_64-apple-darwin,aarch64-apple-darwin | |
| - name: Cache cargo | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Build x86_64 | |
| run: cargo build --release --target x86_64-apple-darwin | |
| - name: Build aarch64 | |
| run: cargo build --release --target aarch64-apple-darwin | |
| - name: Create universal binary | |
| run: | | |
| mkdir -p target/universal/release | |
| lipo -create \ | |
| target/x86_64-apple-darwin/release/aaeq \ | |
| target/aarch64-apple-darwin/release/aaeq \ | |
| -output target/universal/release/aaeq | |
| - name: Create DMG | |
| run: | | |
| # Create app bundle structure | |
| mkdir -p "AAEQ.app/Contents/MacOS" | |
| mkdir -p "AAEQ.app/Contents/Resources" | |
| # Copy binary | |
| cp target/universal/release/aaeq "AAEQ.app/Contents/MacOS/" | |
| chmod +x "AAEQ.app/Contents/MacOS/aaeq" | |
| # Create Info.plist | |
| cat > "AAEQ.app/Contents/Info.plist" <<EOF | |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>CFBundleExecutable</key> | |
| <string>aaeq</string> | |
| <key>CFBundleIdentifier</key> | |
| <string>com.jaschadub.aaeq</string> | |
| <key>CFBundleName</key> | |
| <string>AAEQ</string> | |
| <key>CFBundleVersion</key> | |
| <string>0.1.0</string> | |
| <key>CFBundleShortVersionString</key> | |
| <string>0.1.0</string> | |
| <key>CFBundlePackageType</key> | |
| <string>APPL</string> | |
| <key>LSMinimumSystemVersion</key> | |
| <string>10.13</string> | |
| </dict> | |
| </plist> | |
| EOF | |
| # Create DMG using hdiutil | |
| mkdir dmg_temp | |
| cp -R AAEQ.app dmg_temp/ | |
| hdiutil create -volname "AAEQ" -srcfolder dmg_temp -ov -format UDZO aaeq-macos-universal.dmg | |
| # Also create tar.gz for those who prefer it | |
| cd target/universal/release | |
| tar -czf aaeq-macos-universal.tar.gz aaeq | |
| - name: Upload DMG artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: aaeq-macos-dmg | |
| path: aaeq-macos-universal.dmg | |
| - name: Upload tar.gz artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: aaeq-macos-tarball | |
| path: target/universal/release/aaeq-macos-universal.tar.gz | |
| build-windows: | |
| name: Build Windows | |
| runs-on: windows-latest | |
| needs: test | |
| if: github.event_name == 'release' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache cargo | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Build release | |
| run: cargo build --release --verbose | |
| - name: Create ZIP archive | |
| run: | | |
| cd target/release | |
| 7z a aaeq-windows-x64.zip aaeq.exe | |
| - name: Install cargo-wix | |
| run: cargo install cargo-wix | |
| - name: Build MSI installer | |
| continue-on-error: true | |
| run: cargo wix --nocapture --output target/wix/aaeq-windows-x64.msi -p aaeq | |
| - name: Upload ZIP artifact | |
| if: success() || failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: aaeq-windows-x64-zip | |
| path: target/release/aaeq-windows-x64.zip | |
| - name: Upload MSI artifact | |
| if: success() || failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: aaeq-windows-x64-msi | |
| path: target/wix/aaeq-windows-x64.msi | |
| if-no-files-found: warn | |
| sign-artifacts: | |
| name: Sign Release Artifacts | |
| runs-on: ubuntu-latest | |
| needs: [build-linux, build-linux-arm64, build-macos, build-windows] | |
| if: ${{ always() && github.event_name == 'release' && (needs.build-linux.result == 'success' || needs.build-macos.result == 'success' || needs.build-windows.result == 'success') }} | |
| permissions: | |
| contents: write | |
| id-token: write # Required for OIDC keyless signing | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: List downloaded artifacts | |
| run: | | |
| echo "Available artifacts:" | |
| ls -la artifacts/ || echo "No artifacts directory" | |
| find artifacts -type f || echo "No files found" | |
| - name: Install cosign | |
| uses: sigstore/cosign-installer@v3.7.0 | |
| - name: Sign artifacts with cosign | |
| run: | | |
| # Find and sign all release artifacts | |
| find artifacts -type f \( \ | |
| -name "*.tar.gz" -o \ | |
| -name "*.AppImage" -o \ | |
| -name "*.dmg" -o \ | |
| -name "*.zip" -o \ | |
| -name "*.msi" \ | |
| \) | while read -r file; do | |
| echo "Signing: $file" | |
| cosign sign-blob --yes "$file" --output-signature "${file}.sig" --output-certificate "${file}.pem" | |
| echo "✓ Signed: $file" | |
| done | |
| - name: Verify signatures | |
| run: | | |
| # Verify all signatures were created | |
| find artifacts -type f \( \ | |
| -name "*.tar.gz" -o \ | |
| -name "*.AppImage" -o \ | |
| -name "*.dmg" -o \ | |
| -name "*.zip" -o \ | |
| -name "*.msi" \ | |
| \) | while read -r file; do | |
| if [ -f "${file}.sig" ]; then | |
| echo "✓ Signature exists for: $file" | |
| else | |
| echo "✗ Missing signature for: $file" | |
| exit 1 | |
| fi | |
| done | |
| - name: Upload signed artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: signed-artifacts | |
| path: artifacts/**/* | |
| upload-release-assets: | |
| name: Upload Release Assets | |
| runs-on: ubuntu-latest | |
| needs: sign-artifacts | |
| if: ${{ always() && github.event_name == 'release' && needs.sign-artifacts.result == 'success' }} | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download signed artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: signed-artifacts | |
| path: artifacts | |
| - name: List artifacts to upload | |
| run: | | |
| echo "Artifacts to upload:" | |
| find artifacts -type f || echo "No files found" | |
| - name: Upload Release Assets | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: | | |
| artifacts/aaeq-linux-x64-tarball/*.tar.gz | |
| artifacts/aaeq-linux-x64-tarball/*.tar.gz.sig | |
| artifacts/aaeq-linux-x64-tarball/*.tar.gz.pem | |
| artifacts/aaeq-linux-x64-appimage/*.AppImage | |
| artifacts/aaeq-linux-x64-appimage/*.AppImage.sig | |
| artifacts/aaeq-linux-x64-appimage/*.AppImage.pem | |
| artifacts/aaeq-linux-arm64/*.tar.gz | |
| artifacts/aaeq-linux-arm64/*.tar.gz.sig | |
| artifacts/aaeq-linux-arm64/*.tar.gz.pem | |
| artifacts/aaeq-macos-dmg/*.dmg | |
| artifacts/aaeq-macos-dmg/*.dmg.sig | |
| artifacts/aaeq-macos-dmg/*.dmg.pem | |
| artifacts/aaeq-macos-tarball/*.tar.gz | |
| artifacts/aaeq-macos-tarball/*.tar.gz.sig | |
| artifacts/aaeq-macos-tarball/*.tar.gz.pem | |
| artifacts/aaeq-windows-x64-zip/*.zip | |
| artifacts/aaeq-windows-x64-zip/*.zip.sig | |
| artifacts/aaeq-windows-x64-zip/*.zip.pem | |
| artifacts/aaeq-windows-x64-msi/*.msi | |
| artifacts/aaeq-windows-x64-msi/*.msi.sig | |
| artifacts/aaeq-windows-x64-msi/*.msi.pem | |
| fail_on_unmatched_files: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |