mirror of
https://github.com/NotAShelf/nyxexprs.git
synced 2025-10-03 07:23:32 +00:00
ci: find, build & cache packages missing in cachix
Thanks Diniamo
This commit is contained in:
parent
665c979a1e
commit
6c0a2682ee
2 changed files with 31 additions and 12 deletions
39
.github/workflows/build.yml
vendored
39
.github/workflows/build.yml
vendored
|
@ -8,20 +8,35 @@ on:
|
||||||
required: false
|
required: false
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
find-uncached:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
uncached: ${{ steps.get-packages.outputs.packages }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: DeterminateSystems/nix-installer-action@main
|
||||||
|
|
||||||
|
- name: Find packages missing in the cache
|
||||||
|
id: get-packages
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
packages='[]'
|
||||||
|
while read -r package; do
|
||||||
|
path="$(nix eval --raw ".#$package" 2>/dev/null)"
|
||||||
|
if ! nix path-info --store https://nyx.cachix.org "$path" &>/dev/null; then
|
||||||
|
echo "Building $package"
|
||||||
|
packages="$(echo -n "$packages" | jq --arg package "$package" --compact-output '. + [$package]')"
|
||||||
|
fi
|
||||||
|
done < <(nix flake show --json 2>/dev/null | jq --raw-output '.packages."x86_64-linux" | keys_unsorted | map("packages.x86_64-linux.\(.)") | .[]')
|
||||||
|
|
||||||
|
echo -n "packages=$packages" >> "$GITHUB_OUTPUT"
|
||||||
|
build-uncached:
|
||||||
|
needs: packages
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
package:
|
package: ${{ fromJSON(needs.find_uncached.outputs.uncached) }}
|
||||||
- ai-robots-txt
|
|
||||||
- alejandra-custom
|
|
||||||
- ani-cli-git
|
|
||||||
- foot-git
|
|
||||||
- fuzzel-git
|
|
||||||
- headscale-ui
|
|
||||||
- mastodon-bird-ui
|
|
||||||
- zsh-stripped
|
|
||||||
|
|
||||||
uses: ./.github/workflows/nix.yml
|
uses: ./.github/workflows/nix.yml
|
||||||
with:
|
with:
|
||||||
command: nix build -L .#${{ matrix.package }} -v
|
command: nix build "github:notashelf/nyxexprs/${{ github.ref }}#${{ matrix.package }}"
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
4
.github/workflows/nix.yml
vendored
4
.github/workflows/nix.yml
vendored
|
@ -10,6 +10,10 @@ on:
|
||||||
CACHIX_AUTH_TOKEN:
|
CACHIX_AUTH_TOKEN:
|
||||||
required: false
|
required: false
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
id-token: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
nix:
|
nix:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue