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: |
|
2022-05-18 07:20:39 +00:00
|
|
|
substituters = https://cache.nixos.org/ https://f000.backblazeb2.com/file/cache-chir-rs/
|
|
|
|
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= 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: |
|
|
|
|
nix flake update
|
2022-05-18 20:19:41 +00:00
|
|
|
echo "Difference between this PR and main:" > report
|
|
|
|
echo "" >> report
|
2022-05-18 20:55:26 +00:00
|
|
|
for job in nixos-8gb-fsn1-1 nutty-noon thinkrac nas; do
|
2022-05-18 20:44:14 +00:00
|
|
|
old_job=$(nix build --dry-run "github:DarkKirb/nixos-config/main#hydraJobs.$job.x86_64-linux" 2>&1 | grep nixos-system-$job | grep drv | tail -n1 | sed 's/ //g')
|
|
|
|
new_job=$(nix build --dry-run ".#hydraJobs.$job.x86_64-linux" 2>&1 | grep nixos-system-$job | grep drv | tail -n1 | sed 's/ //g')
|
2022-05-18 20:28:39 +00:00
|
|
|
echo $old_job
|
|
|
|
echo $new_job
|
2022-05-18 20:19:41 +00:00
|
|
|
echo "<details>" >> report
|
|
|
|
echo "<summary>expression difference for $job</summary>" >> report
|
|
|
|
nix run 'nixpkgs#nix-diff' $old_job $new_job >> report
|
|
|
|
echo "</details>" >> report
|
2022-05-15 20:31:22 +00:00
|
|
|
done
|
|
|
|
|
2022-05-20 07:07:32 +00:00
|
|
|
if [ "$(wc -c report | awk '{print $1}')" -gt 131072 ]; then
|
2022-05-20 06:36:33 +00:00
|
|
|
mv report report-artifact.txt
|
|
|
|
echo "Difference is too large for github. Please check the artifact" > report
|
|
|
|
echo ::set-output name=artifact::report-artifact.txt
|
|
|
|
fi
|
|
|
|
|
2022-05-18 21:09:12 +00:00
|
|
|
body=$(cat report)
|
2022-05-15 20:31:22 +00:00
|
|
|
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:
|
2022-05-17 14:16:18 +00:00
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
2022-05-15 20:31:22 +00:00
|
|
|
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
|
2022-05-20 06:36:33 +00:00
|
|
|
- uses: actions/upload-artifact@v3
|
|
|
|
if: steps.update-step.outputs.artifact != ''
|
|
|
|
with:
|
|
|
|
name: deriv-diff
|
2022-05-20 07:18:36 +00:00
|
|
|
path: ${{ github.workspace }}/${{ steps.update-step.outputs.artifact }}
|