Quick fix for new agent package name step-agent #13
Workflow file for this run
This file contains hidden or 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
| name: "Build and populate cache" | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| - master | |
| workflow_dispatch: | |
| jobs: | |
| release-check: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| is-release: ${{ steps.condition-check.outputs.match }} | |
| steps: | |
| - id: condition-check | |
| uses: actions-ecosystem/action-regex-match@v2 | |
| with: | |
| # matches: package_name: vX.Y.Z -> vX.Y.Z where XYZ are digits (including release candidates: vX.Y.Z-rcN) | |
| # it detects a commit from goreleaser with a new nix package version. | |
| regex: '\s*[a-zA-Z][\w]+:\s*v\d+\.\d+\.\d+(-rc\d+|-dev\d+)?\s*->\s*v\d+\.\d+\.\d+(-rc\d+)?' | |
| text: ${{ github.event.head_commit.message }} | |
| tests: | |
| needs: release-check | |
| strategy: | |
| matrix: | |
| nixPath: | |
| - nixpkgs=https://github.com/NixOS/nixpkgs/archive/refs/heads/nixpkgs-unstable.tar.gz | |
| - nixpkgs=https://github.com/NixOS/nixpkgs/archive/refs/heads/nixos-unstable.tar.gz | |
| - nixpkgs=https://github.com/NixOS/nixpkgs/archive/refs/heads/nixos-25.11.tar.gz | |
| runs-on: ubuntu-latest | |
| if: needs.release-check.outputs.is-release != '' | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| - name: Install nix | |
| uses: cachix/install-nix-action@v31 | |
| with: | |
| nix_path: "${{ matrix.nixPath }}" | |
| extra_nix_config: | | |
| experimental-features = nix-command flakes | |
| access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} | |
| - name: Show nixpkgs version | |
| run: nix-instantiate --eval -E '(import <nixpkgs> {}).lib.version' | |
| - name: Check evaluation | |
| run: | | |
| nix-env -f . -qa \* --meta --xml \ | |
| --allowed-uris https://static.rust-lang.org \ | |
| --option restrict-eval true \ | |
| --option allow-import-from-derivation true \ | |
| --drv-path --show-trace \ | |
| -I nixpkgs=$(nix-instantiate --find-file nixpkgs) \ | |
| -I $PWD | |
| - name: Build nix packages | |
| run: nix shell -f '<nixpkgs>' nix-build-uncached -c nix-build-uncached ci.nix -A cacheOutputs | |
| add-pkg: | |
| permissions: | |
| contents: write | |
| needs: [release-check, tests] | |
| runs-on: ubuntu-latest | |
| if: needs.release-check.outputs.is-release != '' | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| - name: Make addpkg script executable | |
| run: chmod +x ./addpkg.sh | |
| - name: Execute addpkg.sh to update nix package's catalog | |
| run: ./addpkg.sh step-agent | |
| - name: Add and Commit default.nix | |
| uses: EndBug/add-and-commit@v9 # Use the specific action | |
| with: | |
| add: 'default.nix' # Specifies the file(s) to add | |
| message: 'Added new nix package version' # The commit message | |
| author_name: 'github-actions[bot]' | |
| author_email: 'github-actions[bot]@users.noreply.github.com' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |