@@ -101,6 +101,27 @@ jobs:
101
101
mv auth gotrue
102
102
tar -czvf auth-v$RELEASE_VERSION.supafast-arm64.tar.gz gotrue migrations/
103
103
104
+ - name : Generate checksums
105
+ if : ${{ steps.release.outputs.release_created == 'true' || steps.release.outputs.prs_created == 'true' }}
106
+ run : |
107
+ set -ex
108
+ # Function to generate checksums for a specific hash type
109
+ generate_checksums() {
110
+ local hash_type=$1
111
+ local hash_cmd=$2
112
+ echo "### ${hash_type}" >> checksums.txt
113
+ for file in auth-v$RELEASE_VERSION*.tar.gz; do
114
+ echo "\`$file\`:\n\`\`\`" >> checksums.txt
115
+ $hash_cmd "$file" | awk '{print $1}' >> checksums.txt
116
+ echo "\`\`\`\n" >> checksums.txt
117
+ done
118
+ }
119
+
120
+ # Generate the checksum file to be appended to the release notes later
121
+ echo "## Checksums" > checksums.txt
122
+ generate_checksums "SHA1" "sha1sum"
123
+ generate_checksums "SHA256" "sha256sum"
124
+
104
125
- name : Upload release artifacts
105
126
if : ${{ steps.release.outputs.release_created == 'true' || steps.release.outputs.prs_created == 'true' }}
106
127
run : |
@@ -109,12 +130,13 @@ jobs:
109
130
if [ "$RELEASE_CANDIDATE" == "true" ]
110
131
then
111
132
PR_NUMBER='${{ steps.release.outputs.pr && fromJSON(steps.release.outputs.pr).number }}'
133
+ CHECKSUM_CONTENT=$(cat checksums.txt)
112
134
113
135
GH_TOKEN='${{ github.token }}' gh release \
114
136
create $RELEASE_NAME \
115
137
--title "v$RELEASE_VERSION" \
116
138
--prerelease \
117
- -n "This is a release candidate. See release-please PR #$PR_NUMBER for context."
139
+ -n "This is a release candidate. See release-please PR #$PR_NUMBER for context.\n\n$CHECKSUM_CONTENT "
118
140
119
141
GH_TOKEN='${{ github.token }}' gh pr comment "$PR_NUMBER" \
120
142
-b "Release candidate [v$RELEASE_VERSION](https://github.com/supabase/gotrue/releases/tag/$RELEASE_NAME) published."
@@ -139,6 +161,12 @@ jobs:
139
161
fi
140
162
fi
141
163
164
+ # Append checksums to existing release notes
165
+ EXISTING_NOTES=$(GH_TOKEN='${{ github.token }}' gh release view $RELEASE_NAME --json body -q .body)
166
+ CHECKSUM_CONTENT=$(cat checksums.txt)
167
+ FULL_NOTES="${EXISTING_NOTES}\n\n${CHECKSUM_CONTENT}"
168
+ GH_TOKEN='${{ github.token }}' gh release edit $RELEASE_NAME -n "$FULL_NOTES"
169
+
142
170
GH_TOKEN='${{ github.token }}' gh release upload $RELEASE_NAME ./auth-v$RELEASE_VERSION-x86.tar.gz ./auth-v$RELEASE_VERSION-arm64.tar.gz ./auth-v$RELEASE_VERSION.supafast-arm64.tar.gz
143
171
144
172
publish :
0 commit comments