Skip to content

Commit feba653

Browse files
committed
no bloat
1 parent 5c35dfc commit feba653

1 file changed

Lines changed: 17 additions & 9 deletions

File tree

.github/workflows/nix-github-actions.yml

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,36 +27,44 @@ jobs:
2727
strategy:
2828
fail-fast: false
2929
matrix: ${{ fromJSON(needs.nix-matrix.outputs.matrix) }}
30+
permissions:
31+
contents: write
32+
id-token: write
3033
steps:
3134
- uses: actions/checkout@v4
3235
- uses: wimpysworld/nothing-but-nix@main
36+
with:
37+
hatchet-protocol: 'rampage'
38+
root-safe-haven: '2048' # 2GB is plenty for the OS
39+
mnt-safe-haven: '1024' # 1GB is enough for small temp files
3340
- uses: DeterminateSystems/determinate-nix-action@main
34-
41+
- uses: DeterminateSystems/magic-nix-cache-action@main
3542
- name: Build and Stage
3643
run: |
3744
nix build -L '.#${{ matrix.attr }}' \
3845
--option system-features "nixos-test benchmark big-parallel kvm" \
3946
--option auto-optimise-store true
4047
41-
mkdir -p staging
42-
# Recursively find any build product and follow symlinks
48+
sync
49+
50+
mkdir -p output
4351
find -L result -type f | while read -r file; do
4452
filename=$(basename "$file")
45-
cp -L "$file" "staging/${{ github.ref_name }}-${{ matrix.system }}-$filename"
53+
# Use 'ln -s' to save space, rather than copy
54+
ln -s "$file" "output/${{ github.ref_name }}-${{ matrix.system }}-$filename"
4655
done
4756
48-
rm result
49-
nix-store --gc
50-
51-
- name: Upload Temporary Artifact
57+
- name: Upload Artifact
5258
uses: actions/upload-artifact@v4
5359
with:
5460
name: artifact-${{ matrix.system }}-${{ matrix.name }}
55-
path: staging/
61+
path: output/
62+
follow-symbolic-links: true
5663
retention-days: 1
5764

5865
release:
5966
needs: nix-build
67+
if: ${{ always() && !cancelled() }} # Always run if an artifact can be used
6068
runs-on: ubuntu-latest
6169
permissions:
6270
contents: write

0 commit comments

Comments
 (0)