-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate installer script for each PR/push
This works by using Cachix feature of serving a file from a store path.
- Loading branch information
1 parent
4e98f03
commit d8daada
Showing
3 changed files
with
89 additions
and
35 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,10 +8,52 @@ jobs: | |
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
CACHIX_NAME: nix-ci | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v2.3.4 | ||
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) | ||
installer: | ||
if: github.event_name == 'push' | ||
needs: tests | ||
runs-on: ubuntu-latest | ||
env: | ||
CACHIX_NAME: nix-ci | ||
outputs: | ||
installerURL: ${{ steps.prepare-installer.outputs.installerURL }} | ||
steps: | ||
- uses: actions/[email protected] | ||
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 }}' | ||
- id: prepare-installer | ||
run: scripts/prepare-installer-for-github-actions | ||
installer_test: | ||
if: github.event_name == 'push' | ||
needs: installer | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
CACHIX_NAME: nix-ci | ||
steps: | ||
- uses: actions/[email protected] | ||
- uses: cachix/install-nix-action@installer_options | ||
with: | ||
install_url: '${{needs.installer.outputs.installerURL}}' | ||
install_options: '--tarball-url-prefix https://${{ env.CACHIX_NAME }}.cachix.org/serve' | ||
- run: nix-instantiate -E 'builtins.currentTime' --eval | ||
|
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
script=$(nix-build -A outputs.hydraJobs.installerScriptForGHA --no-out-link) | ||
installerHash=$(echo $script | cut -b12-43 -) | ||
|
||
installerURL=https://$CACHIX_NAME.cachix.org/serve/$installerHash/install | ||
|
||
echo "::set-output name=installerURL::$installerURL" |