Update bump-notevc.yml

This commit is contained in:
Darwin Cereska
2025-11-10 20:36:49 -05:00
committed by GitHub
parent fc6e6a6299
commit d83172c569

View File

@@ -49,22 +49,29 @@ jobs:
echo "Mac hash: $mac_hash" echo "Mac hash: $mac_hash"
echo "Linux hash: $linux_hash" echo "Linux hash: $linux_hash"
- name: Update Formula file - name: Update Formula file with correct hashes
run: | run: |
version=${{ steps.get_release.outputs.version }} version=${{ steps.get_release.outputs.version }}
mac_hash=${{ steps.hashes.outputs.mac_hash }} mac_hash=${{ steps.hashes.outputs.mac_hash }}
linux_hash=${{ steps.hashes.outputs.linux_hash }} linux_hash=${{ steps.hashes.outputs.linux_hash }}
# Update version
sed -i "s/^ version \".*\"/ version \"${version}\"/" Formula/notevc.rb sed -i "s/^ version \".*\"/ version \"${version}\"/" Formula/notevc.rb
# Update URLs
sed -i "s|notevc/releases/download/v[0-9.]\+/notevc-macos-arm64\"|notevc/releases/download/v${version}/notevc-macos-arm64\"|" Formula/notevc.rb sed -i "s|notevc/releases/download/v[0-9.]\+/notevc-macos-arm64\"|notevc/releases/download/v${version}/notevc-macos-arm64\"|" Formula/notevc.rb
sed -i "s|notevc/releases/download/v[0-9.]\+/notevc-linux-x64\"|notevc/releases/download/v${version}/notevc-linux-x64\"|" Formula/notevc.rb sed -i "s|notevc/releases/download/v[0-9.]\+/notevc-linux-x64\"|notevc/releases/download/v${version}/notevc-linux-x64\"|" Formula/notevc.rb
# Correctly update hashes inside OS blocks
awk -v mac_hash="$mac_hash" -v linux_hash="$linux_hash" ' awk -v mac_hash="$mac_hash" -v linux_hash="$linux_hash" '
/if OS.mac\?/ {print; getline; sub(/sha256 ".*"/, "sha256 \""mac_hash"\""); print; next} /if OS\.mac\?/ {print; getline; sub(/sha256 ".*"/, "sha256 \""mac_hash"\""); print; next}
/elsif OS.linux\?/ {print; getline; sub(/sha256 ".*"/, "sha256 \""linux_hash"\""); print; next} /elsif OS\.linux\?/ {print; getline; sub(/sha256 ".*"/, "sha256 \""linux_hash"\""); print; next}
{print} {print}
' Formula/notevc.rb > Formula/tmp && mv Formula/tmp Formula/notevc.rb ' Formula/notevc.rb > Formula/tmp && mv Formula/tmp Formula/notevc.rb
echo "Updated Formula:"
cat Formula/notevc.rb
- name: Commit and push changes - name: Commit and push changes
run: | run: |
version=${{ steps.get_release.outputs.version }} version=${{ steps.get_release.outputs.version }}