Auto update packages #519
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: 'Auto update packages' | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '55 9 * * *' | |
jobs: | |
auto-update: | |
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@v29 | |
with: | |
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 | |
- name: Cache Nvfetcher Database | |
id: cache-nvfetcher | |
uses: actions/cache@v4 | |
with: | |
path: ~/.local/share/nvfetcher | |
key: nvfetcher | |
- name: Build nix packages | |
run: | | |
cat > secrets.toml <<EOF | |
[keys] | |
github = "${{ secrets.GITHUB_TOKEN }}" | |
EOF | |
nix run .#update | |
rm -f secrets.toml | |
- env: | |
API_TOKEN_GITHUB: ${{ secrets.AUTOMERGE_TOKEN }} | |
run: | | |
# https://github.com/cpina/github-action-push-to-another-repository/issues/75 | |
git config --unset-all http.https://github.com/.extraheader | |
git config --global user.email "[email protected]" | |
git config --global user.name "xddxdd-bot" | |
git add . | |
if git commit -m "auto: update packages" ; then | |
git remote remove origin | |
git remote add origin "https://xddxdd-bot:[email protected]/xddxdd/nur-packages.git" | |
git push -u origin master --force | |
fi |