update Nix packages #284
Workflow file for this run
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 Nix packages" | |
on: | |
schedule: | |
- cron: '53 18 * * 0-4' # AEST 4:53 am | |
workflow_dispatch: | |
inputs: | |
push: { type: boolean, default: false, required: false } | |
env: | |
COMMIT: ${{ github.sha }} | |
jobs: | |
update: | |
strategy: | |
max-parallel: 1 | |
fail-fast: false | |
matrix: | |
pkg: [asli,aslp_web] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: cachix/install-nix-action@v25 | |
- uses: cachix/cachix-action@v14 | |
with: { name: pac-nix, authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' } | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: 'partial-patches-*' | |
merge-multiple: true | |
path: prev-patches | |
- run: | | |
git config user.name 'github-actions[bot]' | |
git config user.email 41898282+github-actions[bot]@users.noreply.github.com | |
- name: git am prev-patches/* | |
run: | | |
shopt -s nullglob | |
set -x | |
for f in prev-patches/*; do git am "$f"; done | |
- run: | | |
nix run .#update -- check -A ${{matrix.pkg}} | |
- run: | | |
nix run .#update -- do-upgrade -A ${{matrix.pkg}} | |
- run: | | |
git format-patch $COMMIT -o new-patches | |
shopt -s nullglob | |
for f in prev-patches/*; do rm -v new-patches/$(basename $f); done | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: partial-patches-${{matrix.pkg}} | |
path: new-patches | |
if-no-files-found: ignore | |
collate: | |
if: ${{ always() }} | |
runs-on: ubuntu-latest | |
needs: [ update ] | |
outputs: | |
url: ${{ steps.public.outputs.url }} | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: 'partial-patches-*' | |
merge-multiple: true | |
path: prev-patches | |
- uses: geekyeggo/delete-artifact@v5 | |
with: | |
name: 'partial-patches-*' | |
- uses: actions/upload-artifact@v4 | |
id: upload | |
with: | |
name: all-patches | |
path: prev-patches | |
if-no-files-found: ignore | |
- name: Re-upload to public site | |
id: public | |
run: | | |
set -x | |
(cd prev-patches && zip -r ../patches.zip .) | |
# accessing github actions artifacts too hard... | |
url="$(curl -F'[email protected]' https://0x0.st)" | |
echo "$url" | |
[[ -n "$url" ]] | |
echo "url=$url" >> "$GITHUB_OUTPUT" | |
build: | |
needs: [ collate ] | |
uses: ./.github/workflows/main.yml | |
with: | |
patches-url: ${{ needs.collate.outputs.url }} | |
push: ${{ inputs.push || github.event_name == 'schedule' }} | |
secrets: inherit | |