-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Harald Hoyer <[email protected]>
- Loading branch information
Showing
1 changed file
with
37 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: cachix | ||
|
||
on: | ||
pull_request: | ||
branches: [ "main" ] | ||
push: | ||
branches: ["main"] | ||
workflow_dispatch: | ||
inputs: | ||
target_branch: | ||
description: "Target branch to upload cachix" | ||
type: string | ||
required: true | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | ||
- uses: cachix/install-nix-action@v27 | ||
with: | ||
extra_nix_config: | | ||
access-tokens = github.com=${{ github.token }} | ||
- uses: cachix/cachix-action@v15 | ||
with: | ||
name: nixsgx | ||
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" | ||
- name: Enable magic Nix cache | ||
uses: DeterminateSystems/magic-nix-cache-action@main | ||
|
||
- name: nix build | ||
run: nix run github:nixos/nixpkgs/nixos-23.11#nixci | ||
|
||
- name: manual cachix upload | ||
run: | | ||
a=($(nix flake show --accept-flake-config --json | jq -r ".packages.\"x86_64-linux\" | keys | @sh" | tr -d \\\' )) | ||
nix build --accept-flake-config --json "${a[@]/#/.#}" | jq -r '.[].outputs | to_entries[].value' | cachix push nixsgx |