Skip to content

Commit f674f8f

Browse files
authored
Upload stable archive to release (#1473)
1 parent 67b689d commit f674f8f

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

.github/workflows/release.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@ jobs:
1515
uses: actions/checkout@v3
1616

1717
- name: Prepare workspace snippet
18-
run: .github/workflows/workspace_snippet.sh > release_notes.txt
18+
run: .github/workflows/workspace_snippet.sh ${{ env.GITHUB_REF_NAME }} > release_notes.txt
1919

2020
- name: Release
2121
uses: softprops/action-gh-release@v1
2222
with:
2323
# Use GH feature to populate the changelog automatically
2424
generate_release_notes: true
2525
body_path: release_notes.txt
26+
fail_on_unmatched_files: true
27+
files: rules_scala-*.tar.gz

.github/workflows/workspace_snippet.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ set -o errexit -o nounset -o pipefail
66
# https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables
77
TAG=${GITHUB_REF_NAME}
88
PREFIX="rules_scala-${TAG:1}"
9-
SHA=$(git archive --format=tar --prefix="${PREFIX}/" "${TAG}" | gzip | shasum -a 256 | awk '{print $1}')
9+
ARCHIVE="rules_scala-$TAG.tar.gz"
10+
git archive --format=tar --prefix=${PREFIX}/ ${TAG} | gzip > $ARCHIVE
11+
SHA=$(shasum -a 256 $ARCHIVE | awk '{print $1}')
1012

1113
cat << EOF
1214
## Using WORKSPACE
@@ -20,7 +22,7 @@ http_archive(
2022
name = "io_bazel_rules_scala",
2123
sha256 = "${SHA}",
2224
strip_prefix = "${PREFIX}",
23-
url = "https://github.com/bazelbuild/rules_scala/archive/refs/tags/${TAG}.tar.gz",
25+
url = "https://github.com/bazelbuild/rules_scala/releases/download/${TAG}/${ARCHIVE}",
2426
)
2527
\`\`\`
2628

0 commit comments

Comments
 (0)