From a43305ac2a86f8a619d94ff49d7ce17ede8691b7 Mon Sep 17 00:00:00 2001 From: Silvio Tomatis Date: Sat, 7 Dec 2024 22:38:26 +0100 Subject: [PATCH] Make one successful win build --- .github/workflows/build.yml | 170 ------------------------------------ 1 file changed, 170 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5344732..b8aaa1f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,133 +7,6 @@ name: CI # are not yet available for this platform in vcpkg jobs: - flatpak: - name: "Flatpak" - runs-on: ubuntu-24.04 - container: - image: bilelmoussaoui/flatpak-github-actions:gnome-47 - options: --privileged - strategy: - matrix: - arch: [x86_64, aarch64] - fail-fast: false - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Install deps - if: ${{ matrix.arch != 'x86_64' }} - run: | - dnf -y install docker - - name: Set up QEMU - if: ${{ matrix.arch != 'x86_64' }} - id: qemu - uses: docker/setup-qemu-action@v2 - with: - platforms: arm64 - - uses: flatpak/flatpak-github-actions/flatpak-builder@v6 - with: - bundle: aardvark.flatpak - manifest-path: org.p2panda.aardvark.json - cache-key: flatpak-builder-${{ github.sha }} - arch: ${{ matrix.arch }} - - macos: - name: "macOS" - runs-on: macos-latest - strategy: - fail-fast: false - matrix: - include: - - target: x86_64-apple-darwin - arch: x86_64 - - target: aarch64-apple-darwin - arch: arm64 - steps: - - uses: actions/checkout@v4 - - uses: moonrepo/setup-rust@v1 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - - # Cache Rust build artifacts - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-${{ matrix.arch }}-cargo-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-${{ matrix.arch }}-cargo- - - # Cache Homebrew packages - - uses: actions/cache@v3 - with: - path: | - ~/Library/Caches/Homebrew - /usr/local/Homebrew - /opt/homebrew - key: ${{ runner.os }}-${{ matrix.arch }}-brew-${{ hashFiles('.github/workflows/build.yml') }} - restore-keys: | - ${{ runner.os }}-${{ matrix.arch }}-brew- - - - name: Install dependencies - run: | - if [ "${{ matrix.arch }}" = "x86_64" ]; then - # Install x86_64 versions for Intel builds - arch -x86_64 /usr/local/bin/brew install pkg-config gtk4 pango cairo gdk-pixbuf at-spi2-core graphene libadwaita || true - arch -x86_64 /usr/local/bin/brew upgrade pkg-config gtk4 pango cairo gdk-pixbuf at-spi2-core graphene libadwaita || true - echo "PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/opt/gdk-pixbuf/lib/pkgconfig:/usr/local/opt/pango/lib/pkgconfig:/usr/local/opt/cairo/lib/pkgconfig:/usr/local/opt/graphene/lib/pkgconfig:/usr/local/Cellar/gdk-pixbuf/*/lib/pkgconfig" >> $GITHUB_ENV - else - # Install ARM64 versions for Apple Silicon builds - brew install pkg-config gtk4 pango cairo gdk-pixbuf at-spi2-core graphene libadwaita || true - brew upgrade pkg-config gtk4 pango cairo gdk-pixbuf at-spi2-core graphene libadwaita || true - echo "PKG_CONFIG_PATH=/opt/homebrew/lib/pkgconfig" >> $GITHUB_ENV - fi - echo "PKG_CONFIG_ALLOW_CROSS=1" >> $GITHUB_ENV - - name: Add target ${{ matrix.target }} - run: rustup target add ${{ matrix.target }} - - name: Build - env: - PKG_CONFIG_ALLOW_CROSS: "1" - CFLAGS: "-I/usr/local/include -I/usr/local/include/gtk-4.0 -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include" - LDFLAGS: "-L/usr/local/lib -framework Cocoa -framework Security" - MACOSX_DEPLOYMENT_TARGET: "10.15" - PKG_CONFIG_SYSROOT_DIR: "" - PKG_CONFIG_PATH: "${{ env.PKG_CONFIG_PATH }}" - run: cargo build --release --target ${{ matrix.target }} - - name: Create App Bundle - run: | - mkdir -p Aardvark.app/Contents/MacOS - cp target/${{ matrix.target }}/release/aardvark Aardvark.app/Contents/MacOS/ - # Create Info.plist - you'll need to customize this - cat > Aardvark.app/Contents/Info.plist << EOF - - - - - CFBundleExecutable - aardvark - CFBundleIdentifier - org.p2panda.aardvark - CFBundleName - Aardvark - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - - - EOF - - name: Create DMG - run: | - hdiutil create -volname "Aardvark" -srcfolder Aardvark.app -ov -format UDZO aardvark-${{ matrix.arch }}.dmg - - name: Upload Artifact - uses: actions/upload-artifact@v3 - with: - name: aardvark-macos-${{ matrix.arch }} - path: aardvark-${{ matrix.arch }}.dmg - windows: name: "Windows" runs-on: windows-latest @@ -176,46 +49,3 @@ jobs: vcpkg install gtk4:$env:VCPKG_TRIPLET vcpkg install libadwaita:$env:VCPKG_TRIPLET shell: pwsh - - - name: Configure pkg-config paths - run: | - $installPrefix = "$env:VCPKG_ROOT\installed\$env:VCPKG_TRIPLET" - - Write-Host "Setting up PATH..." - echo "$installPrefix\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - echo "$env:VCPKG_ROOT\downloads\tools\pkgconfig\windows\pkg-config-0.29.2-3\tools\pkg-config-0.29.2\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - - Write-Host "Setting up pkg-config environment..." - echo "PKG_CONFIG=$env:VCPKG_ROOT\downloads\tools\pkgconfig\windows\pkg-config-0.29.2-3\tools\pkg-config-0.29.2\bin\pkg-config.exe" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - echo "PKG_CONFIG_PATH=$installPrefix\lib\pkgconfig" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - echo "PKG_CONFIG_LIBDIR=$installPrefix\lib\pkgconfig" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - echo "PKG_CONFIG_ALLOW_CROSS=1" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - echo "PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - shell: pwsh - - - name: Verify pkg-config setup - run: | - Write-Host "Verifying pkg-config installation..." - pkg-config --version - Write-Host "Checking library configurations..." - pkg-config --debug --print-errors --cflags --libs glib-2.0 - pkg-config --debug --print-errors --cflags --libs gtk4 libadwaita-1 - shell: pwsh - - name: Build - run: | - $arch = "${{ matrix.arch }}" - $target = if ($arch -eq "x64") { "x86_64-pc-windows-msvc" } else { "aarch64-pc-windows-msvc" } - cargo build --release --target $target - shell: pwsh - - name: Package - run: | - mkdir aardvark-${{ matrix.arch }} - copy target/${{ matrix.arch == 'x64' && 'x86_64-pc-windows-msvc' || 'aarch64-pc-windows-msvc' }}/release/aardvark.exe aardvark-${{ matrix.arch }}/ - # Add any additional DLLs or resources here - - name: Create ZIP - run: Compress-Archive -Path aardvark-${{ matrix.arch }} -DestinationPath aardvark-windows-${{ matrix.arch }}.zip - - name: Upload Artifact - uses: actions/upload-artifact@v3 - with: - name: aardvark-windows-${{ matrix.arch }} - path: aardvark-windows-${{ matrix.arch }}.zip