Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 20b4328

Browse files
committedFeb 15, 2021
Generate installer script for each PR/push
This works by using Cachix feature of serving a file from a store path.
1 parent 4e98f03 commit 20b4328

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed
 

‎.github/workflows/test.yml

+11
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,21 @@ jobs:
88
matrix:
99
os: [ubuntu-latest, macos-latest]
1010
runs-on: ${{ matrix.os }}
11+
env:
12+
CACHIX_NAME: nix-ci
1113
steps:
1214
- uses: actions/checkout@v2
1315
with:
1416
fetch-depth: 0
1517
- uses: cachix/install-nix-action@v12
18+
- uses: cachix/cachix-action@v8
19+
with:
20+
name: '${{ env.CACHIX_NAME }}'
21+
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
1622
#- run: nix flake check
1723
- run: nix-build -A checks.$(if [[ `uname` = Linux ]]; then echo x86_64-linux; else echo x86_64-darwin; fi)
24+
- run: scripts/prepare-installer-for-github-actions
25+
- uses: actions/upload-artifact@v2
26+
with:
27+
name: installer.sh
28+
path: installer.sh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
3+
installerHash=$(nix-instantiate -A outputs.hydraJobs.installerScript.outPath --eval | cut -b13-44)
4+
5+
cat << EOF > installer.sh
6+
curl -sfL https://$CACHIX_NAME.cachix.org/serve/$installerHash/install \
7+
| sh --tarball-url https://$CACHIX_NAME.cachix.org/serve "\$@"
8+
EOF

0 commit comments

Comments
 (0)
Please sign in to comment.