Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pin releases on cachix #884

Merged
merged 1 commit into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .github/workflows/buildtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,18 @@ jobs:
name: devenv
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: |
nix profile remove '.*'
nix profile install --accept-flake-config .
nix profile remove '.*'
nix profile install --accept-flake-config .
- name: Run tests
run: |
devenv ci
devenv shell devenv-run-tests
devenv search ncdu | grep "pkgs\.ncdu"
pin:
needs: build
if: startsWith(github.ref, 'refs/tags/v')
uses: ./.github/workflows/pin.yml
secrets: inherit
generate-examples:
runs-on: ubuntu-latest
outputs:
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/pin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: "Pin release on Cachix"

on:
workflow_dispatch:
inputs:
tag:
description: "The existing tag to build and pin"
type: "string"
required: true

workflow_call:
secrets:
CACHIX_AUTH_TOKEN:
required: true

jobs:
pin:
if: startsWith(github.ref, 'refs/tags/v')

strategy:
fail-fast: false
matrix:
os: [[ubuntu-latest], [macos-latest], [self-hosted, macOS], [nscloud-arm64]]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v23
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- uses: cachix/cachix-action@v12
with:
name: devenv
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}

- name: Pin release
run: cachix pin devenv ${{ github.ref_name }} $(nix build --accept-flake-config --print-out-paths)
Loading