Skip to content

Commit

Permalink
gha: merge build and build-unfree
Browse files Browse the repository at this point in the history
  • Loading branch information
SomeoneSerge committed Dec 26, 2023
1 parent e49b718 commit 94aba6c
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 66 deletions.
48 changes: 0 additions & 48 deletions .github/workflows/build-unfree.yml

This file was deleted.

49 changes: 31 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,48 +22,61 @@ jobs:
strategy:
fail-fast: false
matrix:
# Set this to notify the global nur package registry that changes are
# available.
#
# The repo name as used in
# https://github.com/nix-community/NUR/blob/master/repos.json
nurRepo:
- some-pkgs
# Set this to cache your build results in cachix for faster builds
# in CI and for everyone who uses your cache.
#
# Format: Your cachix cache host name without the ".cachix.org" suffix.
# Example: mycache (for mycache.cachix.org)
#
# For this to work, you also need to set the CACHIX_SIGNING_KEY or
# CACHIX_AUTH_TOKEN secret in your repository secrets settings in
# Github found at
# https://github.com/<your_githubname>/nur-packages/settings/secrets
cachixName:
- pkgs
- some-unfree
os: [ ubuntu-latest, macos-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Nix
if: ${{ matrix.cachixName == 'pkgs' }}
uses: DeterminateSystems/nix-installer-action@v9
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
extra-conf: |
extra-substituters: https://pkgs.cachix.org
extra-trusted-public-keys: pkgs.cachix.org-1:/fnDPhnDwMjJA8IXJl+eAJmnU3n/jgfgvb6SZGuq4gs=
- name: Install Nix (with unfree substituters)
if: ${{ matrix.cachixName == 'some-unfree' }}
uses: DeterminateSystems/nix-installer-action@v9
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
extra-conf: |
extra-substituters = https://some-unfree.cachix.org https://pkgs.cachix.org
extra-trusted-public-keys = some-unfree.cachix.org-1:2/+ag/3nMOroWbHV2UXRuxo9c2VkVb6mUUy7sCXDe1Y= pkgs.cachix.org-1:/fnDPhnDwMjJA8IXJl+eAJmnU3n/jgfgvb6SZGuq4gs=
- uses: DeterminateSystems/magic-nix-cache-action@v2
with:
upstream_cache: https://${{ matrix.cachixName }}.cachix.org
- name: Setup cachix
# Don't replace <YOUR_CACHIX_NAME> here!
if: ${{ matrix.cachixName != '<YOUR_CACHIX_NAME>' }}
if: ${{ matrix.cachixName == 'pkgs' }}
uses: cachix/cachix-action@v13
with:
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
name: ${{ matrix.cachixName }}
- name: Setup cachix
if: ${{ matrix.cachixName == 'some-unfree' }}
uses: cachix/cachix-action@v13
with:
authToken: '${{ secrets.CACHIX_AUTH_TOKEN_UNFREE }}'
name: ${{ matrix.cachixName }}
- name: Show nixpkgs version
run: nix-instantiate --eval -E '(import <nixpkgs> {}).lib.version'
run: nix eval nixpkgs#lib.version
- name: Build some-pkgs
if: ${{ matrix.cachixName == 'pkgs' }}
run: nix run github:Mic92/nix-fast-build -- --skip-cached --no-nom --flake ".#legacyPackages.$(nix eval --raw --impure --expr builtins.currentSystem).pkgs.some-pkgs"
- name: Build some-pkgs-py
if: ${{ matrix.cachixName == 'pkgs' }}
run: nix run github:Mic92/nix-fast-build -- --skip-cached --no-nom --flake ".#legacyPackages.$(nix eval --raw --impure --expr builtins.currentSystem).pkgs.some-pkgs-py"
- name: Build some-pkgs
if: ${{ matrix.cachixName == 'some-unfree' }}
run: nix run github:Mic92/nix-fast-build -- --skip-cached --no-nom --flake ".#legacyPackages.$(nix eval --raw --impure --expr builtins.currentSystem).pkgsCuda.some-pkgs"
- name: Build some-pkgs-py
if: ${{ matrix.cachixName == 'some-unfree' }}
run: nix run github:Mic92/nix-fast-build -- --skip-cached --no-nom --flake ".#legacyPackages.$(nix eval --raw --impure --expr builtins.currentSystem).pkgsCuda.some-pkgs-py"
- name: Trigger NUR update
# Don't replace <YOUR_REPO_NAME> here!
if: ${{ matrix.nurRepo != '<YOUR_REPO_NAME>' }}
Expand Down

0 comments on commit 94aba6c

Please sign in to comment.