@@ -35,54 +35,12 @@ jobs:
3535 steps :
3636 - name : Checkout Repo
3737 uses : supabase/postgres/.github/actions/shared-checkout@HEAD
38- - name : aws-creds
39- uses : aws-actions/configure-aws-credentials@v4
40- if : ${{ github.secret_source == 'Actions' }}
38+ - uses : ./.github/actions/nix-install-ephemeral
4139 with :
42- role-to-assume : ${{ secrets.DEV_AWS_ROLE }}
43- aws-region : " us-east-1"
44- output-credentials : true
45- role-duration-seconds : 7200
46- - name : Setup AWS credentials for Nix
47- if : ${{ github.secret_source == 'Actions' }}
48- run : |
49- sudo -H aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID
50- sudo -H aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY
51- sudo -H aws configure set aws_session_token $AWS_SESSION_TOKEN
52- - name : write secret key
53- # use python so we don't interpolate the secret into the workflow logs, in case of bugs
54- run : |
55- sudo mkdir -p /etc/nix
56- sudo -E python -c "import os; file = open('/etc/nix/nix-secret-key', 'w'); file.write(os.environ['NIX_SIGN_SECRET_KEY']); file.close()"
40+ push-to-cache : ${{ github.secret_source == 'Actions' && 'true' || 'false' }}
5741 env :
42+ DEV_AWS_ROLE : ${{ secrets.DEV_AWS_ROLE }}
5843 NIX_SIGN_SECRET_KEY : ${{ secrets.NIX_SIGN_SECRET_KEY }}
59- - name : Setup cache script
60- if : ${{ github.secret_source == 'Actions' }}
61- run : |
62- cat << 'EOF' | sudo tee /etc/nix/upload-to-cache.sh > /dev/null
63- #!/usr/bin/env bash
64- set -euf
65- export IFS=' '
66- /nix/var/nix/profiles/default/bin/nix copy --to 's3://nix-postgres-artifacts?secret-key=/etc/nix/nix-secret-key' $OUT_PATHS
67- EOF
68- sudo chmod +x /etc/nix/upload-to-cache.sh
69- - name : Install nix
70- uses : cachix/install-nix-action@v27
71- if : ${{ github.secret_source == 'Actions' }}
72- with :
73- install_url : https://releases.nixos.org/nix/nix-2.29.1/install
74- extra_nix_config : |
75- substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com
76- trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
77- post-build-hook = /etc/nix/upload-to-cache.sh
78- - name : Install nix
79- uses : cachix/install-nix-action@v27
80- if : ${{ github.secret_source == 'None' }}
81- with :
82- install_url : https://releases.nixos.org/nix/nix-2.29.1/install
83- extra_nix_config : |
84- substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com
85- trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
8644 - name : Aggressive disk cleanup for DuckDB build
8745 if : matrix.runner == 'macos-latest-xlarge'
8846 run : |
10866 sudo rm -rf /tmp/* 2>/dev/null || true
10967 echo "=== AFTER CLEANUP ==="
11068 df -h
111- - name : Build psql bundle
69+ -
70+ name : Build psql bundle
11271 run : >
11372 nix run "github:Mic92/nix-fast-build?rev=b1dae483ab7d4139a6297e02b6de9e5d30e43d48"
11473 -- --skip-cached --no-nom ${{ matrix.runner == 'macos-latest-xlarge' && '--max-jobs 1' || '' }}
0 commit comments