auto: update packages #2214
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: 'Build and populate cache' | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
- master | |
jobs: | |
build-packages: | |
strategy: | |
fail-fast: false | |
matrix: | |
system: | |
- x86_64-linux | |
# - aarch64-linux | |
ci-command: | |
- ci | |
- ci-cuda | |
runs-on: ubuntu-latest | |
env: | |
GIT_SSL_NO_VERIFY: 'true' | |
steps: | |
- name: Maximize build space | |
uses: easimon/maximize-build-space@master | |
with: | |
root-reserve-mb: 512 | |
swap-size-mb: 1024 | |
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@v4 | |
with: | |
token: ${{ secrets.AUTOMERGE_TOKEN }} | |
- 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@v30 | |
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.GITHUB_TOKEN }} | |
extra-platforms = i686-linux aarch64-linux arm-linux | |
keep-going = true | |
log-lines = 25 | |
substituters = https://nix-community.cachix.org https://cache.garnix.io https://cache.nixos.org/ | |
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs= cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g= | |
trusted-substituters = https://nix-community.cachix.org https://cache.garnix.io https://cache.nixos.org/ | |
- name: Setup Attic cache | |
uses: ryanccn/attic-action@v0 | |
continue-on-error: true | |
with: | |
endpoint: https://attic.xuyh0120.win | |
cache: lantian | |
token: ${{ secrets.ATTIC_TOKEN }} | |
- name: Set nix daemon tmpdir path | |
run: | | |
sudo mkdir -p /nix/tmpdir | |
sudo chown "$(whoami)" /nix/tmpdir | |
cat > override.conf <<EOF | |
[Service] | |
Environment="TMPDIR=/nix/tmpdir" | |
EOF | |
sudo mkdir /etc/systemd/system/nix-daemon.service.d/ | |
sudo mv override.conf /etc/systemd/system/nix-daemon.service.d/override.conf | |
sudo systemctl daemon-reload | |
sudo systemctl restart nix-daemon | |
- name: Build nix packages | |
run: | | |
echo "::group::Preparing" | |
env TMPDIR=/nix/tmpdir nix run .#${{ matrix.ci-command }} -- ${{ matrix.system }} | |
- name: Commit back to repository | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
if: ${{ success() || failure() }} | |
with: | |
commit_message: 'auto: update package hashes' | |
test-nur-eval: | |
runs-on: ubuntu-latest | |
env: | |
GIT_SSL_NO_VERIFY: 'true' | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- 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@v30 | |
with: | |
nix_path: nixpkgs=channel:nixos-unstable | |
extra_nix_config: | | |
experimental-features = nix-command flakes ca-derivations | |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} | |
extra-platforms = i686-linux aarch64-linux arm-linux | |
- name: Build nix packages | |
run: | | |
nix run .#nur-check | |
check-package-meta: | |
runs-on: ubuntu-latest | |
env: | |
GIT_SSL_NO_VERIFY: 'true' | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- 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@v30 | |
with: | |
nix_path: nixpkgs=channel:nixos-unstable | |
extra_nix_config: | | |
experimental-features = nix-command flakes ca-derivations | |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} | |
extra-platforms = i686-linux aarch64-linux arm-linux | |
- name: Build nix packages | |
run: | | |
tools/check_package_meta.py | |
update-nur: | |
runs-on: ubuntu-latest | |
needs: | |
- build-packages | |
- test-nur-eval | |
- check-package-meta | |
steps: | |
- name: Trigger NUR update | |
run: curl -XPOST "https://nur-update.nix-community.org/update?repo=xddxdd" | |
# update-flakehub: | |
# runs-on: ubuntu-latest | |
# needs: | |
# - build-packages | |
# - test-nur-eval | |
# - check-package-meta | |
# permissions: | |
# id-token: 'write' | |
# contents: 'read' | |
# steps: | |
# - uses: 'actions/checkout@v4' | |
# - uses: 'DeterminateSystems/nix-installer-action@main' | |
# - uses: 'DeterminateSystems/flakehub-push@main' | |
# with: | |
# name: 'xddxdd/nur-packages' | |
# rolling: true | |
# visibility: 'public' |