Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nix
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 71c9dbdf4d02
Choose a base ref
...
head repository: NixOS/nix
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: cd227c025473
Choose a head ref
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on Feb 15, 2021

  1. Generate installer script for each PR/push

    This works by using Cachix feature of serving a file from
    a store path.
    domenkozar committed Feb 15, 2021

    Verified

    This commit was signed with the committer’s verified signature.
    domenkozar Domen Kožar
    Copy the full SHA
    cd227c0 View commit details
Showing with 39 additions and 1 deletion.
  1. +27 −1 .github/workflows/test.yml
  2. +12 −0 scripts/prepare-installer-for-github-actions
28 changes: 27 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -8,10 +8,36 @@ 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:
needs: tests
runs-on: ubuntu-latest
env:
CACHIX_NAME: nix-ci
steps:
- 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: scripts/prepare-installer-for-github-actions
- run: tar czf installer.tar.gz installer.sh # workaround for https://github.com/actions/upload-artifact/issues/38
- uses: actions/upload-artifact@v2
with:
name: installer
path: installer.tar.gz
12 changes: 12 additions & 0 deletions scripts/prepare-installer-for-github-actions
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

# TODO: ideally we could pass this into the flake?
sed -i 's/"x86_64-linux" "i686-linux" "x86_64-darwin" "aarch64-linux"/"x86_64-linux" "x86_64-darwin"/' flake.nix

script=$(nix-build -A outputs.hydraJobs.installerScript --no-out-link)
installerHash=$(cut -b12-43 $script)

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