From 8e8efc304f97354745642c4ed53e7170a583512f Mon Sep 17 00:00:00 2001 From: Seth Flynn Date: Wed, 29 Jan 2025 08:24:42 -0500 Subject: [PATCH 1/2] ci: separate nix job Signed-off-by: Seth Flynn (cherry picked from commit 417688089d756da23ca3f482a32871963d289211) Signed-off-by: Seth Flynn --- .github/workflows/build.yml | 56 ------------------- .github/workflows/nix.yml | 80 +++++++++++++++++++++++++++ .github/workflows/trigger_builds.yml | 1 - .github/workflows/trigger_release.yml | 1 - 4 files changed, 80 insertions(+), 58 deletions(-) create mode 100644 .github/workflows/nix.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ff2d346d4..93d33e2d3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,9 +39,6 @@ on: APPLE_NOTARIZE_PASSWORD: description: Password used for notarizing macOS builds required: false - CACHIX_AUTH_TOKEN: - description: Private token for authenticating against Cachix cache - required: false GPG_PRIVATE_KEY: description: Private key for AppImage signing required: false @@ -667,56 +664,3 @@ jobs: bundle: PrismLauncher-${{ runner.os }}-${{ env.VERSION }}-Flatpak.flatpak manifest-path: flatpak/org.prismlauncher.PrismLauncher.yml arch: ${{ matrix.arch }} - - nix: - name: Nix (${{ matrix.system }}) - - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-22.04 - system: x86_64-linux - - - os: ubuntu-22.04-arm - system: aarch64-linux - - - os: macos-13 - system: x86_64-darwin - - - os: macos-14 - system: aarch64-darwin - - runs-on: ${{ matrix.os }} - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Install Nix - uses: cachix/install-nix-action@v30 - - # For PRs - - name: Setup Nix Magic Cache - uses: DeterminateSystems/magic-nix-cache-action@v8 - - # For in-tree builds - - name: Setup Cachix - uses: cachix/cachix-action@v15 - with: - name: prismlauncher - authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} - - - name: Run flake checks - run: | - nix flake check --print-build-logs --show-trace - - - name: Build debug package - if: ${{ inputs.build_type == 'Debug' }} - run: | - nix build --print-build-logs .#prismlauncher-debug - - - name: Build release package - if: ${{ inputs.build_type != 'Debug' }} - run: | - nix build --print-build-logs .#prismlauncher diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml new file mode 100644 index 000000000..f167440cd --- /dev/null +++ b/.github/workflows/nix.yml @@ -0,0 +1,80 @@ +name: Nix + +on: + push: + paths-ignore: + - "**.md" + - "**/LICENSE" + - ".github/ISSUE_TEMPLATE/**" + - ".markdownlint**" + - "flatpak/**" + tags: + - "*" + pull_request: + paths-ignore: + - "**.md" + - "**/LICENSE" + - ".github/ISSUE_TEMPLATE/**" + - ".markdownlint**" + - "flatpak/**" + workflow_dispatch: + +permissions: + contents: read + +env: + DEBUG: ${{ github.ref_type != 'tag' }} + +jobs: + build: + name: Build (${{ matrix.system }}) + + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-22.04 + system: x86_64-linux + + - os: ubuntu-22.04-arm + system: aarch64-linux + + - os: macos-13 + system: x86_64-darwin + + - os: macos-14 + system: aarch64-darwin + + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Nix + uses: cachix/install-nix-action@v30 + + # For PRs + - name: Setup Nix Magic Cache + uses: DeterminateSystems/magic-nix-cache-action@v9 + + # For in-tree builds + - name: Setup Cachix + uses: cachix/cachix-action@v15 + with: + name: prismlauncher + authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} + + - name: Run Flake checks + run: | + nix flake check --print-build-logs --show-trace + + - name: Build debug package + if: ${{ env.DEBUG }} + run: | + nix build --print-build-logs .#prismlauncher-debug + + - name: Build release package + if: ${{ !env.DEBUG }} + run: | + nix build --print-build-logs .#prismlauncher diff --git a/.github/workflows/trigger_builds.yml b/.github/workflows/trigger_builds.yml index 0b8386d69..9efafc8cc 100644 --- a/.github/workflows/trigger_builds.yml +++ b/.github/workflows/trigger_builds.yml @@ -38,6 +38,5 @@ jobs: APPLE_NOTARIZE_APPLE_ID: ${{ secrets.APPLE_NOTARIZE_APPLE_ID }} APPLE_NOTARIZE_TEAM_ID: ${{ secrets.APPLE_NOTARIZE_TEAM_ID }} APPLE_NOTARIZE_PASSWORD: ${{ secrets.APPLE_NOTARIZE_PASSWORD }} - CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} GPG_PRIVATE_KEY_ID: ${{ secrets.GPG_PRIVATE_KEY_ID }} diff --git a/.github/workflows/trigger_release.yml b/.github/workflows/trigger_release.yml index e800653e3..134281b2c 100644 --- a/.github/workflows/trigger_release.yml +++ b/.github/workflows/trigger_release.yml @@ -22,7 +22,6 @@ jobs: APPLE_NOTARIZE_APPLE_ID: ${{ secrets.APPLE_NOTARIZE_APPLE_ID }} APPLE_NOTARIZE_TEAM_ID: ${{ secrets.APPLE_NOTARIZE_TEAM_ID }} APPLE_NOTARIZE_PASSWORD: ${{ secrets.APPLE_NOTARIZE_PASSWORD }} - CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} GPG_PRIVATE_KEY_ID: ${{ secrets.GPG_PRIVATE_KEY_ID }} From 702db71f61651d271bab920acccaf8d92ef46d1c Mon Sep 17 00:00:00 2001 From: Seth Flynn Date: Wed, 29 Jan 2025 08:28:05 -0500 Subject: [PATCH 2/2] ci: separate flatpak job Signed-off-by: Seth Flynn (cherry picked from commit 49d734f3142328a71506b28c8c1cdcb99788c34d) Signed-off-by: Seth Flynn --- .github/workflows/build.yml | 38 --------------------- .github/workflows/flatpak.yml | 62 +++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 38 deletions(-) create mode 100644 .github/workflows/flatpak.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 93d33e2d3..3361dbd2d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -626,41 +626,3 @@ jobs: shell: msys2 {0} run: | ccache -s - - flatpak: - name: Flatpak (${{ matrix.arch }}) - - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-22.04 - arch: x86_64 - - - os: ubuntu-22.04-arm - arch: aarch64 - - runs-on: ${{ matrix.os }} - - container: - image: ghcr.io/flathub-infra/flatpak-github-actions:kde-6.8 - options: --privileged - - steps: - - name: Checkout - uses: actions/checkout@v4 - if: inputs.build_type == 'Debug' - with: - submodules: true - - - name: Set short version - shell: bash - run: echo "VERSION=${GITHUB_SHA::7}" >> $GITHUB_ENV - - - name: Build Flatpak (Linux) - if: inputs.build_type == 'Debug' - uses: flatpak/flatpak-github-actions/flatpak-builder@v6 - with: - bundle: PrismLauncher-${{ runner.os }}-${{ env.VERSION }}-Flatpak.flatpak - manifest-path: flatpak/org.prismlauncher.PrismLauncher.yml - arch: ${{ matrix.arch }} diff --git a/.github/workflows/flatpak.yml b/.github/workflows/flatpak.yml new file mode 100644 index 000000000..41cc2a51d --- /dev/null +++ b/.github/workflows/flatpak.yml @@ -0,0 +1,62 @@ +name: Flatpak + +on: + push: + paths-ignore: + - "**.md" + - "**/LICENSE" + - ".github/ISSUE_TEMPLATE/**" + - ".markdownlint**" + - "nix/**" + # We don't do anything with these artifacts on releases. They go to Flathub + tags-ignore: + - "*" + pull_request: + paths-ignore: + - "**.md" + - "**/LICENSE" + - ".github/ISSUE_TEMPLATE/**" + - ".markdownlint**" + - "nix/**" + workflow_dispatch: + +permissions: + contents: read + +jobs: + build: + name: Build (${{ matrix.arch }}) + + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-22.04 + arch: x86_64 + + - os: ubuntu-22.04-arm + arch: aarch64 + + runs-on: ${{ matrix.os }} + + container: + image: ghcr.io/flathub-infra/flatpak-github-actions:kde-6.8 + options: --privileged + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: true + + - name: Set short version + shell: bash + run: | + echo "VERSION=${GITHUB_SHA::7}" >> "$GITHUB_ENV" + + - name: Build Flatpak + uses: flatpak/flatpak-github-actions/flatpak-builder@v6 + with: + bundle: PrismLauncher-${{ runner.os }}-${{ env.VERSION }}-Flatpak.flatpak + manifest-path: flatpak/org.prismlauncher.PrismLauncher.yml + arch: ${{ matrix.arch }}