Skip to content

Commit 82fdd33

Browse files
authored
chore: publish release artifact (#44)
GitHub had promised that their source archives would have stable checksums, but then there was a big Bazel outage yesterday due to their changing it. Even if they do make such a guarantee and stick to it, we also have the problem that GitHub doesn't give download metrics on their source archive so this is still worth changing.
1 parent 0bcaef5 commit 82fdd33

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,5 @@ jobs:
3636
# Use GH feature to populate the changelog automatically
3737
generate_release_notes: true
3838
body_path: release_notes.txt
39+
fail_on_unmatched_files: true
40+
files: rules_mylang-*.tar.gz

.github/workflows/workspace_snippet.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@ set -o errexit -o nounset -o pipefail
55
# Set by GH actions, see
66
# https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables
77
TAG=${GITHUB_REF_NAME}
8+
# The prefix is chosen to match what GitHub generates for source archives
89
PREFIX="rules_mylang-${TAG:1}"
9-
SHA=$(git archive --format=tar --prefix=${PREFIX}/ ${TAG} | gzip | shasum -a 256 | awk '{print $1}')
10+
ARCHIVE="rules_mylang-$TAG.tar.gz"
11+
git archive --format=tar --prefix=${PREFIX}/ ${TAG} | gzip > $ARCHIVE
12+
SHA=$(shasum -a 256 $ARCHIVE | awk '{print $1}')
1013

1114
cat << EOF
1215
WORKSPACE snippet:
@@ -16,7 +19,7 @@ http_archive(
1619
name = "com_myorg_rules_mylang",
1720
sha256 = "${SHA}",
1821
strip_prefix = "${PREFIX}",
19-
url = "https://github.com/myorg/rules_mylang/archive/refs/tags/${TAG}.tar.gz",
22+
url = "https://github.com/myorg/rules_mylang/releases/download/${TAG}/rules_mylang-${TAG}.tar.gz",
2023
)
2124
EOF
2225

0 commit comments

Comments
 (0)