release-24.11 #23
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
name: release-24.11 | |
on: | |
schedule: | |
- cron: "11 0 * * *" | |
permissions: | |
contents: read | |
jobs: | |
build-and-cache: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: release-24.11 | |
- name: Install Nix | |
uses: cachix/install-nix-action@v27 | |
with: | |
github_access_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Cachix | |
uses: cachix/cachix-action@v15 | |
with: | |
name: autofirma-nix | |
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | |
- name: Update flake | |
shell: /usr/bin/bash -o pipefail -e {0} | |
run: | | |
nix --accept-flake-config flake update | |
- name: Build packages (if autofirma changed hashes this will update them) | |
shell: /usr/bin/bash -o pipefail -e {0} | |
run: | | |
nix --accept-flake-config build -L .#autofirma .#configuradorfnmt .#dnieremote 2>&1 | .github/workflows/replace_mismatching_hashes.pl | |
nix --accept-flake-config flake check | |
- name: Compile autofirma with new hashes | |
id: build-updated-autofirma | |
if: failure() | |
shell: /usr/bin/bash -o pipefail -e {0} | |
run: | | |
nix --accept-flake-config build -L .#autofirma .#configuradorfnmt .#dnieremote | |
nix --accept-flake-config flake check | |
- name: Generate token | |
uses: tibdex/github-app-token@v1 | |
if: ${{ failure() && steps.build-updated-autofirma.conclusion == 'success' }} | |
id: generate-token | |
with: | |
app_id: ${{ secrets.APP_ID }} | |
private_key: ${{ secrets.APP_PRIVATE_KEY }} | |
- name: Create Pull Request for the new working hashes | |
if: ${{ failure() && steps.build-updated-autofirma.conclusion == 'success' }} | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
token: ${{ steps.generate-token.outputs.token }} | |
branch: bot/update-release-24.11 | |
assignees: | | |
nilp0inter | |
CesarGallego | |
commit-message: 'fix: update derivation hashes & bump flake.lock' | |
title: 'Updated hashes for `release-24.11`' | |
body: | | |
This is an automatic update. Please test before merging! | |
To test, run the following command: | |
```console | |
nix --accept-flake-config run github:nix-community/autofirma-nix/pull/<this_pr_number>/head#autofirma | |
``` | |
add-paths: | | |
nix/ | |
flake.lock | |
- name: Push to Cachix | |
if: ${{ success() || steps.build-updated-autofirma.conclusion == 'success' }} | |
shell: /usr/bin/bash -o pipefail -e {0} | |
run: | | |
nix --accept-flake-config build --json .#autofirma .#configuradorfnmt .#dnieremote | jq -r '.[].outputs | to_entries[].value' | cachix push autofirma-nix |