fix: secondary outputs (e.g. .python, etc) not being cached #56
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build with Nix | |
on: | |
push: | |
jobs: | |
build-and-test: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
[ | |
{ | |
name: "Ubuntu 24.04", | |
family: "linux", | |
runner: "ubuntu-24.04", | |
archs: "x86_64", | |
}, | |
{ | |
name: "Ubuntu 22.04", | |
family: "linux", | |
runner: "ubuntu-22.04-arm", | |
archs: "aarch64", | |
}, | |
{ | |
name: "macOS 13", | |
family: "macos", | |
runner: "macos-13", | |
archs: "x86_64", | |
}, | |
{ | |
name: "macOS 14", | |
family: "macos", | |
runner: "macos-14", | |
archs: "arm64", | |
}, | |
] | |
name: Nix Builds | ${{ matrix.os.name }} | ${{ matrix.os.archs }} | |
runs-on: ${{ matrix.os.runner }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Nix (+ add GitHub Token to Environment) | |
uses: ./.github/actions/install_nix | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
nix_cache_domain: ${{ vars.NIX_CACHE }} | |
nix_public_key: ${{ vars.NIX_PUBLIC_KEY }} | |
- id: enumerate_packages | |
name: Get all packages | |
run: | | |
echo "FLAKE_OUTPUTS=$(python3 ./.github/workflows/get_all_packages.py)" >> $GITHUB_ENV | |
- name: Build All | |
run: | | |
set +e | |
error=0 | |
for flake in $FLAKE_OUTPUTS; do | |
echo "Building $flake..." | |
nix build --no-link $flake --show-trace | |
error=$((error | $?)) | |
done | |
set -e | |
exit $error | |
- name: Sign and Cache Nix Builds to S3 | |
uses: ./.github/actions/nix_sign_cache_s3 | |
if: steps.enumerate_packages.outcome == 'success' | |
with: | |
flake_outputs: ${{ env.FLAKE_OUTPUTS }} | |
nix_public_key: ${{ vars.NIX_PUBLIC_KEY }} | |
nix_private_key: ${{ secrets.NIX_PRIVATE_KEY }} | |
s3_bucket_name: ${{ vars.NIX_CACHE }} | |
aws_region: ${{ secrets.AWS_REGION }} | |
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |