ci: throw the thing away and do something different
This commit is contained in:
parent
02dfcb17d5
commit
0aaf795cec
1 changed files with 24 additions and 38 deletions
|
@ -1,31 +1,10 @@
|
||||||
on: [push]
|
on: [push]
|
||||||
jobs:
|
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:
|
build:
|
||||||
runs-on: cacher
|
runs-on: cacher
|
||||||
needs: [generate-targets]
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
target: ${{ fromJSON(needs.generate-targets.outputs.targets) }}
|
system: [x86_64-linux, aarch64-linux]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
@ -38,24 +17,31 @@ jobs:
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
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
|
runs-on: cacher
|
||||||
needs: [generate-targets]
|
needs: [build]
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
target: ${{ fromJSON(needs.generate-targets.outputs.machines) }}
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Download outputs
|
||||||
uses: actions/checkout@v4
|
uses: forgejo/download-artifact@v4
|
||||||
|
with:
|
||||||
|
path: system-paths
|
||||||
|
pattern: system-paths-*
|
||||||
|
|
||||||
- name: Drop in ops/secrets/default.nix
|
- run: |
|
||||||
run: |
|
jq -s add system-paths/*.json > system-paths.json
|
||||||
echo "$OPS_SECRETS_DEFAULTNIX" > ops/secrets/default.nix
|
|
||||||
env:
|
|
||||||
OPS_SECRETS_DEFAULTNIX: "${{ secrets.OPS_SECRETS_DEFAULTNIX }}"
|
|
||||||
|
|
||||||
- name: Build
|
- name: Upload merged
|
||||||
run: |
|
uses: forgejo/upload-artifact@v4
|
||||||
nix-build ci-root.nix -A "machine.${{ matrix.target }}"
|
with:
|
||||||
|
name: system-paths
|
||||||
|
path: system-paths.json
|
||||||
|
|
Loading…
Reference in a new issue