Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Generate installer script for each PR/push
This works by using Cachix feature of serving a file from
a store path.
  • Loading branch information
domenkozar committed Feb 15, 2021
1 parent 4e98f03 commit 20b4328
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/test.yml
Expand Up @@ -8,10 +8,21 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
env:
CACHIX_NAME: nix-ci
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: cachix/install-nix-action@v12
- uses: cachix/cachix-action@v8
with:
name: '${{ env.CACHIX_NAME }}'
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
#- run: nix flake check
- run: nix-build -A checks.$(if [[ `uname` = Linux ]]; then echo x86_64-linux; else echo x86_64-darwin; fi)
- run: scripts/prepare-installer-for-github-actions
- uses: actions/upload-artifact@v2
with:
name: installer.sh
path: installer.sh
8 changes: 8 additions & 0 deletions scripts/prepare-installer-for-github-actions
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

installerHash=$(nix-instantiate -A outputs.hydraJobs.installerScript.outPath --eval | cut -b13-44)

cat << EOF > installer.sh
curl -sfL https://$CACHIX_NAME.cachix.org/serve/$installerHash/install \
| sh --tarball-url https://$CACHIX_NAME.cachix.org/serve "\$@"
EOF

0 comments on commit 20b4328

Please sign in to comment.