From 96b4b59a9b975c14c0655b020cc5cf4e290bb305 Mon Sep 17 00:00:00 2001 From: Lan Tian Date: Mon, 8 Dec 2025 20:36:34 -0800 Subject: [PATCH] Setup CI task to auto update flake.lock --- .github/workflows/auto-update.yml | 90 ++++++++++++++++++++++++------- 1 file changed, 72 insertions(+), 18 deletions(-) diff --git a/.github/workflows/auto-update.yml b/.github/workflows/auto-update.yml index c08e51f..af5d93c 100644 --- a/.github/workflows/auto-update.yml +++ b/.github/workflows/auto-update.yml @@ -1,24 +1,78 @@ -name: 'Flake.lock: update Nix dependencies' - +name: 'Auto update packages' on: - workflow_dispatch: # allows manual triggering + workflow_dispatch: schedule: - - cron: '37 17 * * 5' # runs weekly on Friday at 17:37 - + - cron: '37 17 * * *' jobs: - nix-flake-update: - permissions: - contents: write - id-token: write - issues: write - pull-requests: write + auto-update: runs-on: ubuntu-latest + env: + GIT_SSL_NO_VERIFY: 'true' steps: - - uses: actions/checkout@v4 - - uses: DeterminateSystems/determinate-nix-action@v3 - - uses: DeterminateSystems/update-flake-lock@main + - name: Maximize build space + uses: easimon/maximize-build-space@master with: - pr-title: 'Update Nix flake inputs' # Title of PR to be created - pr-labels: | # Labels to be set on the PR - dependencies - automated + root-reserve-mb: 8192 + temp-reserve-mb: 1024 + swap-size-mb: 4096 + build-mount-path: '/nix' + remove-dotnet: 'true' + remove-android: 'true' + remove-haskell: 'true' + remove-codeql: 'true' + remove-docker-images: 'true' + + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Set up QEMU + id: qemu + uses: docker/setup-qemu-action@v3 + with: + image: tonistiigi/binfmt:latest + platforms: all + + - name: Install nix + uses: cachix/install-nix-action@v31 + with: + nix_path: nixpkgs=channel:nixos-unstable + extra_nix_config: | + experimental-features = nix-command flakes ca-derivations + extra-experimental-features = nix-command flakes ca-derivations + access-tokens = github.com=${{ secrets.AUTOMERGE_TOKEN }} + extra-platforms = i686-linux aarch64-linux arm-linux + log-lines = 25 + + - name: Set nix daemon tmpdir path + run: | + sudo mkdir -p /nix/tmpdir + sudo chown "$(whoami)" /nix/tmpdir + + cat > override.conf <