Fix hash conversion in NixOS update workflow
All checks were successful
Build and Release / build-and-release (push) Successful in 2m38s
All checks were successful
Build and Release / build-and-release (push) Successful in 2m38s
- Replace xxd with Python for hex to base64 conversion - Use standard tools available in GitHub Actions runners - Should fix hash conversion error in automated workflow
This commit is contained in:
parent
1ed4666dfd
commit
60ef712fac
@ -108,8 +108,9 @@ jobs:
|
|||||||
|
|
||||||
# Download tarball to get correct hash
|
# Download tarball to get correct hash
|
||||||
curl -L -o cm-dashboard.tar.gz "$TARBALL_URL"
|
curl -L -o cm-dashboard.tar.gz "$TARBALL_URL"
|
||||||
|
# Convert sha256 hex to base64 for Nix hash format using Python
|
||||||
NEW_HASH=$(sha256sum cm-dashboard.tar.gz | cut -d' ' -f1)
|
NEW_HASH=$(sha256sum cm-dashboard.tar.gz | cut -d' ' -f1)
|
||||||
NIX_HASH="sha256-$(echo -n $NEW_HASH | xxd -r -p | base64)"
|
NIX_HASH="sha256-$(python3 -c "import base64, binascii; print(base64.b64encode(binascii.unhexlify('$NEW_HASH')).decode())")"
|
||||||
|
|
||||||
# Update the NixOS configuration
|
# Update the NixOS configuration
|
||||||
sed -i "s/version = \"v[^\"]*\"/version = \"$VERSION\"/" hosts/common/cm-dashboard.nix
|
sed -i "s/version = \"v[^\"]*\"/version = \"$VERSION\"/" hosts/common/cm-dashboard.nix
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user