From 0aaf795ceccad6b658d65c8b51b481b53b4dc87b Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Sun, 29 Dec 2024 23:54:02 +0000 Subject: [PATCH] ci: throw the thing away and do something different --- .forgejo/workflows/ci.yaml | 62 +++++++++++++++----------------------- 1 file changed, 24 insertions(+), 38 deletions(-) diff --git a/.forgejo/workflows/ci.yaml b/.forgejo/workflows/ci.yaml index d2988909f9..94a1424861 100644 --- a/.forgejo/workflows/ci.yaml +++ b/.forgejo/workflows/ci.yaml @@ -1,31 +1,10 @@ on: [push] jobs: - generate-targets: - runs-on: cacher - outputs: - targets: ${{ steps.build.outputs.targets }} - machines: ${{ steps.build.outputs.machines }} - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Drop in ops/secrets/default.nix - run: - echo "$OPS_SECRETS_DEFAULTNIX" > ops/secrets/default.nix - env: - OPS_SECRETS_DEFAULTNIX: "${{ secrets.OPS_SECRETS_DEFAULTNIX }}" - - - id: build - name: Build matrix - run: | - cat "$(nix-build ci-root.nix -A forgejoMatrix)" >> "$GITHUB_OUTPUT" - build: runs-on: cacher - needs: [generate-targets] strategy: matrix: - target: ${{ fromJSON(needs.generate-targets.outputs.targets) }} + system: [x86_64-linux, aarch64-linux] steps: - name: Checkout repository uses: actions/checkout@v4 @@ -38,24 +17,31 @@ jobs: - name: Build run: | - nix-build ci-root.nix -A "${{ matrix.target }}" + nix-build ci-root.nix -A linkFarm --system "${{ matrix.system }}" - build-machine: + cat result/other-systemPathJSON > system-path-${{ matrix.system }}.json + + - name: Upload system paths + uses: forgejo/upload-artifact@v4 + with: + name: system-paths-${{ matrix.system }} + path: system-paths-${{ matrix.system }}.json + + combine-systems: runs-on: cacher - needs: [generate-targets] - strategy: - matrix: - target: ${{ fromJSON(needs.generate-targets.outputs.machines) }} + needs: [build] steps: - - name: Checkout repository - uses: actions/checkout@v4 + - name: Download outputs + uses: forgejo/download-artifact@v4 + with: + path: system-paths + pattern: system-paths-* - - name: Drop in ops/secrets/default.nix - run: | - echo "$OPS_SECRETS_DEFAULTNIX" > ops/secrets/default.nix - env: - OPS_SECRETS_DEFAULTNIX: "${{ secrets.OPS_SECRETS_DEFAULTNIX }}" + - run: | + jq -s add system-paths/*.json > system-paths.json - - name: Build - run: | - nix-build ci-root.nix -A "machine.${{ matrix.target }}" + - name: Upload merged + uses: forgejo/upload-artifact@v4 + with: + name: system-paths + path: system-paths.json