2022-04-15 18:25:17 +00:00
|
|
|
name: Update flake
|
|
|
|
on:
|
|
|
|
schedule:
|
2022-05-15 20:31:22 +00:00
|
|
|
- cron: "35 4 * * *"
|
2022-04-15 18:43:00 +00:00
|
|
|
workflow_dispatch: {}
|
2022-04-15 18:25:17 +00:00
|
|
|
jobs:
|
|
|
|
update-flake:
|
|
|
|
name: Update flake
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-04-15 19:56:22 +00:00
|
|
|
- uses: actions/checkout@v3
|
2022-04-15 18:48:55 +00:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.PUBLISH_TOKEN }}
|
2022-04-16 16:55:02 +00:00
|
|
|
- uses: cachix/install-nix-action@v17
|
2022-04-16 16:56:47 +00:00
|
|
|
with:
|
|
|
|
extra_nix_config: |
|
|
|
|
substituters = https://f000.backblazeb2.com/file/cache-chir-rs/ https://cache.nixos.org/
|
|
|
|
trusted-public-keys = nixcache:8KKuGz95Pk4UJ5W/Ni+pN+v+LDTkMMFV4yrGmAYgkDg= hydra.nixos.org-1:CNHJZBh9K4tP3EKF6FkkgeVYsS3ohTl+oS0Qa8bezVs=
|
2022-05-15 20:31:22 +00:00
|
|
|
# instantiate the current derivations
|
|
|
|
- id: update-step
|
|
|
|
run: |
|
|
|
|
for job in nixos-8gb-fsn1-1 nutty-noon thinkrac installer nas; do
|
2022-05-16 07:37:39 +00:00
|
|
|
nix show-derivation -r ".#hydraJobs.$job.x86_64-linux" > old-$job.json
|
2022-05-15 20:31:22 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
nix flake update
|
|
|
|
|
|
|
|
for job in nixos-8gb-fsn1-1 nutty-noon thinkrac installer nas; do
|
2022-05-16 07:37:39 +00:00
|
|
|
nix show-derivation -r ".#hydraJobs.$job.x86_64-linux" > new-$job.json
|
2022-05-15 20:31:22 +00:00
|
|
|
|
2022-05-15 20:39:47 +00:00
|
|
|
python scripts/diff-drvs.py old-$job.json new-$job.json > report-$job.txt
|
2022-05-15 20:31:22 +00:00
|
|
|
cat report-$job.txt >> full-report.txt
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ -s full-report.txt ]; then
|
|
|
|
echo "Automatic flake.lock update" > pr-message.txt
|
|
|
|
echo "" >> pr-message.txt
|
|
|
|
for job in nixos-8gb-fsn1-1 nutty-noon thinkrac installer nas; do
|
|
|
|
echo "## Changes for $job:" >> pr-message.txt
|
2022-05-16 09:09:10 +00:00
|
|
|
echo '```' >> pr-message.txt
|
2022-05-15 20:31:22 +00:00
|
|
|
cat report-$job.txt >> pr-message.txt
|
2022-05-16 09:09:10 +00:00
|
|
|
echo '```' >> pr-message.txt
|
2022-05-15 20:31:22 +00:00
|
|
|
done
|
|
|
|
else
|
|
|
|
touch pr-message.txt
|
|
|
|
fi
|
|
|
|
|
|
|
|
body=$(cat pr-message.txt)
|
|
|
|
body="${body//'%'/'%25'}"
|
|
|
|
body="${body//$'\n'/'%0A'}"
|
|
|
|
body="${body//$'\r'/'%0D'}"
|
|
|
|
echo ::set-output name=body::$body
|
|
|
|
- uses: peter-evans/create-pull-request@v4
|
2022-05-15 20:34:41 +00:00
|
|
|
if: steps.update-step.outputs.body != ''
|
2022-05-15 20:31:22 +00:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.PUBLISH_TOKEN }}
|
|
|
|
body: ${{ steps.update-step.outputs.body }}
|
|
|
|
commit-message: Update flake.lock
|
|
|
|
committer: GitHub <noreply@github.com>
|
2022-05-16 09:09:10 +00:00
|
|
|
author: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
|
2022-05-15 20:31:22 +00:00
|
|
|
branch: update-flake
|
|
|
|
delete-branch: true
|
|
|
|
title: "Update flake.nix"
|
|
|
|
labels: |
|
|
|
|
update
|
|
|
|
automated
|
|
|
|
assignees: darkkirb
|
|
|
|
reviewers: darkkirb
|
2022-05-15 20:34:41 +00:00
|
|
|
add-paths: flake.lock
|