Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DO NOT MERGE] Testing Github workflow #26

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/verify-sha.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Verify Spacetime SHA Hashes

on:
push:
branches: [ master ]
pull_request:

jobs:
verify-sha:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3

- name: Parse ARM/AMD URL and SHA from Formula/spacetime.rb
id: parse
run: |
# Extract ARM url and sha256 (between `if Hardware::CPU.arm?` and `else`)
URL_ARM=$(awk '/if Hardware::CPU.arm\?/,/else/' Formula/spacetime.rb | grep 'url' | sed 's/.*"\(.*\)".*/\1/')
SHA_ARM=$(awk '/if Hardware::CPU.arm\?/,/else/' Formula/spacetime.rb | grep 'sha256' | sed 's/.*"\(.*\)".*/\1/')

# Extract AMD url and sha256 (between `else` and `end`)
URL_AMD=$(awk '/else/,/end/' Formula/spacetime.rb | grep 'url' | sed 's/.*"\(.*\)".*/\1/')
SHA_AMD=$(awk '/else/,/end/' Formula/spacetime.rb | grep 'sha256' | sed 's/.*"\(.*\)".*/\1/')

echo "URL_ARM=$URL_ARM" >> $GITHUB_ENV
echo "SHA_ARM=$SHA_ARM" >> $GITHUB_ENV
echo "URL_AMD=$URL_AMD" >> $GITHUB_ENV
echo "SHA_AMD=$SHA_AMD" >> $GITHUB_ENV

- name: Verify ARM tarball
run: |
curl -L "$URL_ARM" -o spacetime-arm.tar.gz
echo "$SHA_ARM spacetime-arm.tar.gz" | sha256sum --check

- name: Verify AMD tarball
run: |
curl -L "$URL_AMD" -o spacetime-amd.tar.gz
echo "$SHA_AMD spacetime-amd.tar.gz" | sha256sum --check

2 changes: 1 addition & 1 deletion Formula/spacetime.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Spacetime < Formula
sha256 "230740fee768fcc62aa0882d705b107a8715ebcbb7c3c125310919c8e7e2169f"
else
url "https://github.com/clockworklabs/SpacetimeDB/releases/download/v1.0.0-rc3-hotfix1/spacetime.darwin-amd64.tar.gz"
sha256 "3a64e7e72620a9af4d50db95d2d37f6c00bb64e0c55332b610e613c6d39b44bc"
sha256 "230740fee768fcc62aa0882d705b107a8715ebcbb7c3c125310919c8e7e2169f"
end


Expand Down
Loading