ref: 9e6cbaf315de73685ac16b2d3db2ca027c8fbc22
parent: 6d94013f04950dbe64f0f675325e17b16f106234
author: K. Adam Christensen <pope@shifteleven.com>
date: Tue Aug 6 17:32:49 EDT 2024
Update nix-package workflow to work with flake.nix
--- a/.github/workflows/nix-package.yml
+++ b/.github/workflows/nix-package.yml
@@ -1,4 +1,4 @@
-name: Update Version and Hash in default.nix
+name: Update Version and Hash in flake.nix
on:
push:
@@ -42,15 +42,15 @@
echo "valid=false" >> $GITHUB_OUTPUT
fi
- - name: Update version in default.nix
+ - name: Update version in flake.nix
if: steps.valid-tag.outputs.valid
run: |
latest_annotated_tag="${{ steps.newest-tag.outputs.latest_annotated_tag }}" latest_annotated_tag_without_v="${latest_annotated_tag#v}" # Remove 'v' prefix- sed -i "s/version = \".*\";/version = \"$latest_annotated_tag_without_v\";/" default.nix
+ sed -i "s/version = \".*\";/version = \"$latest_annotated_tag_without_v\";/" flake.nix
new_hash=$(nix-prefetch-url --unpack --type sha256 "https://github.com/laamaa/m8c/archive/v$latest_annotated_tag_without_v.tar.gz") # Use updated variable name
- sed -i "s/hash = \".*\";/hash = \"sha256:$new_hash\";/" default.nix
+ sed -i "s/hash = \".*\";/hash = \"sha256:$new_hash\";/" flake.nix
git config user.email "github-actions@github.com"
git config user.name "GitHub Actions"
- git commit -am "Update version and hash in default.nix to $latest_annotated_tag_without_v"
+ git commit -am "Update version and hash in flake.nix to $latest_annotated_tag_without_v"
git push origin HEAD:main
--
⑨