name: Build on: # Build on new commits or pull requests. push: paths-ignore: - '**.md' - '**.po' - '**.pot' pull_request: schedule: # Run every week just to make sure the CI environment still works. - cron: '0 0 * * 0' env: DOTNET_VERSION: 8.0.x PINTA_VERSION: 3.1.2 jobs: build-ubuntu: runs-on: ubuntu-24.04 # Test building with .NET 8 and .NET 9 strategy: matrix: dotnet_version: [8.0.x, 9.0.x] env: # Skip pkg-config version checks. Ubuntu 22.04 doesn't have a recent # enough version of the libraries for some symbols needed at runtime, # but this doesn't matter for building. ADW_1_CFLAGS: undefined ADW_1_LIBS: undefined GTK_CFLAGS: undefined GTK_LIBS: undefined steps: - name: Set environment variables run: echo "BUILD_DIR=${{runner.temp}}/pinta-${{env.PINTA_VERSION}}" >> $GITHUB_ENV - uses: actions/checkout@v6 - name: Setup .NET uses: actions/setup-dotnet@v5 with: dotnet-version: ${{matrix.dotnet_version}} - name: Install Apt Dependencies run: | sudo apt update sudo apt install autotools-dev autoconf-archive gettext intltool libadwaita-1-dev - name: Generate Tarball run: | ./autogen.sh make dist mkdir ${{env.BUILD_DIR}} tar -xzf pinta-${{env.PINTA_VERSION}}.tar.gz -C ${{runner.temp}} - name: Create temporary global.json if: matrix.dotnet_version == '9.0.x' run: mv .github/workflows/dotnet9.global.json ${{env.BUILD_DIR}}/global.json - name: Build working-directory: ${{env.BUILD_DIR}} run: | ./configure --prefix ${{runner.temp}}/pinta-install make build - name: Test working-directory: ${{env.BUILD_DIR}} run: make test - name: Verify code formatting if: matrix.dotnet_version == '9.0.x' # Ignore warning CA1416 for unavailable platform-specific code, since this is unrelated to formatting. run: dotnet format --no-restore --verify-no-changes --exclude-diagnostics CA1416 - name: Test Install working-directory: ${{env.BUILD_DIR}} run: make install - name: Build Installer working-directory: ${{env.BUILD_DIR}} run: make releasezip - name: Upload Installer uses: actions/upload-artifact@v6 with: name: Pinta-linux-dotnet-${{matrix.dotnet_version}}.zip path: ${{env.BUILD_DIR}}/pinta-${{env.PINTA_VERSION}}.zip if-no-files-found: error build-macos: # Build for both intel and arm64 strategy: matrix: build: [ { dotnet_rid: osx-arm64, lib_path: "/opt/homebrew/lib", runner: macos-14 }, { dotnet_rid: osx-x64, lib_path: "/usr/local/lib", runner: macos-15-intel }] name: build-macos (${{matrix.build.dotnet_rid}}) runs-on: ${{matrix.build.runner}} steps: - uses: actions/checkout@v6 - name: Setup .NET uses: actions/setup-dotnet@v5 with: dotnet-version: ${{env.DOTNET_VERSION}} - name: Install Dependencies env: # Work around webp-pixbuf-loader issue: https://github.com/Homebrew/homebrew-core/issues/139497 HOMEBREW_NO_INSTALL_FROM_API: 1 run: brew install libadwaita adwaita-icon-theme gettext webp-pixbuf-loader - name: Build run: dotnet build Pinta.sln -c Release - name: Test env: # Add libraries from homebrew to the search path so they can be loaded by gir.core DYLD_LIBRARY_PATH: ${{matrix.build.lib_path}} run: dotnet test Pinta.sln -c Release - name: Add Cert to Keychain if: github.event_name != 'pull_request' uses: apple-actions/import-codesign-certs@v6 with: p12-file-base64: ${{ secrets.MAC_CERTS_BASE64 }} p12-password: ${{ secrets.MAC_CERTS_PASSWORD }} - name: Build Installer if: github.event_name != 'pull_request' env: MAC_DEV_PASSWORD: ${{ secrets.MAC_DEV_PASSWORD }} run: | cd installer/macos ./build_installer.sh ${{matrix.build.dotnet_rid}} - name: Upload Installer if: github.event_name != 'pull_request' uses: actions/upload-artifact@v6 with: name: "Pinta-${{matrix.build.dotnet_rid}}.dmg" path: installer/macos/Pinta.dmg if-no-files-found: error build-windows: # Build for both x64 and arm64 strategy: matrix: build: [ { dotnet_rid: win-x64, mingw_folder: "${MINGW_PREFIX}/../clang64", mingw_system: clang64, mingw_repo: clang-x86_64, setup_arch: x64os, runner: windows-2025 }, { dotnet_rid: win-arm64, mingw_folder: "${MINGW_PREFIX}/../clangarm64", mingw_system: clangarm64, mingw_repo: clang-aarch64, setup_arch: arm64, runner: windows-11-arm }] name: build-windows (${{matrix.build.dotnet_rid}}) runs-on: ${{matrix.build.runner}} defaults: run: shell: msys2 {0} steps: - uses: actions/checkout@v6 - uses: microsoft/setup-msbuild@v2.0.0 - name: Setup .NET uses: actions/setup-dotnet@v5 with: dotnet-version: ${{env.DOTNET_VERSION}} - name: Install dependencies uses: msys2/setup-msys2@v2 with: path-type: inherit # Inherit the path so that dotnet can be found update: true msystem: ${{matrix.build.mingw_system}} install: mingw-w64-${{matrix.build.mingw_repo}}-libadwaita mingw-w64-${{matrix.build.mingw_repo}}-webp-pixbuf-loader - name: Build run: dotnet build Pinta.sln -c Release -p:MinGWFolder=${{matrix.build.mingw_folder}} - name: Test run: dotnet test Pinta.sln -c Release -p:MinGWFolder=${{matrix.build.mingw_folder}} # Note that msgfmt is already available from the Git for Windows installation! - name: Build Installer run: | choco install innosetup -y -v dotnet publish Pinta/Pinta.csproj -p:BuildTranslations=true -p:MinGWFolder=${{matrix.build.mingw_folder}} -c Release -r ${{matrix.build.dotnet_rid}} --self-contained true -p:PublishDir=../release/bin cp -r release/bin/icons release/bin/locale release/share/ rm -rf release/bin/icons release/bin/locale cp installer/macos/hicolor.index.theme release/share/icons/hicolor/index.theme iscc -DProductArch="${{matrix.build.setup_arch}}" installer/windows/installer.iss - name: Upload Installer id: upload-unsigned-installer uses: actions/upload-artifact@v6 with: name: "Pinta-${{matrix.build.dotnet_rid}}.exe" path: installer/windows/Pinta.exe if-no-files-found: error # Only enable signing for commits on the release branch. - name: Sign Installer if: github.event_name != 'pull_request' uses: signpath/github-action-submit-signing-request@v2 with: api-token: '${{ secrets.SIGNPATH_API_TOKEN }}' organization-id: "fb6d32c7-2808-4358-b9eb-f7482eb8c0a5" project-slug: Pinta signing-policy-slug: release-signing artifact-configuration-slug: Zipped_Exe github-artifact-id: '${{ steps.upload-unsigned-installer.outputs.artifact-id }}' wait-for-completion: true output-artifact-directory: './signed-artifacts' - name: Upload Signed Installer if: github.event_name != 'pull_request' id: upload-signed-installer uses: actions/upload-artifact@v6 with: name: "Pinta-signed-${{matrix.build.dotnet_rid}}.exe" path: ./signed-artifacts/Pinta.exe if-no-files-found: error