Update hashes #823
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: Update hashes | |
on: | |
workflow_dispatch: # allows manual triggering | |
schedule: | |
- cron: '00 8 * * *' # runs daily at 8:00 | |
jobs: | |
update-hashes: | |
if: github.repository_owner == 'astro' | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Nix | |
uses: cachix/install-nix-action@v23 | |
with: | |
extra_nix_config: | | |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} | |
- name: Set environment variables | |
shell: bash | |
run: | | |
echo "GIT_AUTHOR_NAME=github-actions[bot]" >> $GITHUB_ENV | |
echo "GIT_AUTHOR_EMAIL=<github-actions[bot]@users.noreply.github.com>" >> $GITHUB_ENV | |
echo "GIT_COMMITTER_NAME=github-actions[bot]" >> $GITHUB_ENV | |
echo "GIT_COMMITTER_EMAIL=<github-actions[bot]@users.noreply.github.com>" >> $GITHUB_ENV | |
- name: Update all hashes | |
shell: bash | |
run: | | |
git rm hashes/*.nix | |
nix run .#generate-all-hashes | |
git add hashes/*.nix | |
git commit -m "hashes: update" | |
- name: Update latest release | |
shell: bash | |
run: | | |
nix eval -f generate-latest-release.nix > latest-release.nix | |
git add latest-release.nix | |
git commit -m "latest-release: update" || true | |
- name: Cache OpenWrt profile information | |
shell: bash | |
run: | | |
git rm cached-profiles/* | |
mkdir -p cached-profiles | |
nix build -vL .#cached-profiles | |
cp -L result/*.nix cached-profiles/ | |
git add cached-profiles | |
git commit -m "cached-profiles: update" || true | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.ref }} |