From 94aba6c2fd8788726defcf7784382294d301458f Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Tue, 26 Dec 2023 05:43:46 +0000 Subject: [PATCH] gha: merge build and build-unfree --- .github/workflows/build-unfree.yml | 48 ----------------------------- .github/workflows/build.yml | 49 +++++++++++++++++++----------- 2 files changed, 31 insertions(+), 66 deletions(-) delete mode 100644 .github/workflows/build-unfree.yml diff --git a/.github/workflows/build-unfree.yml b/.github/workflows/build-unfree.yml deleted file mode 100644 index f10cee9..0000000 --- a/.github/workflows/build-unfree.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: "nix-build --arg cudaSupport true" -on: - pull_request: - push: - branches: - - master - - unfree - schedule: - - cron: '50 6 * * *' - workflow_dispatch: -jobs: - nix-build: - strategy: - fail-fast: false - matrix: - nurRepo: - - some-pkgs - os: [ ubuntu-latest, macos-latest ] - runs-on: ${{ matrix.os }} - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Install Nix - uses: DeterminateSystems/nix-installer-action@v9 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - - uses: DeterminateSystems/magic-nix-cache-action@v2 - - name: Consume the read-only free cachix - uses: cachix/cachix-action@v13 - with: - name: some-unfree - - name: Consume read-only cuda-maintainers cachix - uses: cachix/cachix-action@v13 - with: - name: cuda-maintainers - - name: Setup writeable unfree cachix - uses: cachix/cachix-action@v13 - with: - authToken: '${{ secrets.CACHIX_AUTH_TOKEN_UNFREE }}' - name: some-unfree - - name: Build some-pkgs - 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 - 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 here! - if: ${{ matrix.nurRepo != '' }} - run: curl -XPOST "https://nur-update.nix-community.org/update?repo=${{ matrix.nurRepo }}" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8119b8c..1a3499f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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//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 here! - if: ${{ matrix.cachixName != '' }} + 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 {}).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 here! if: ${{ matrix.nurRepo != '' }}