Skip to content

Commit

Permalink
release: publish release artifact (#302)
Browse files Browse the repository at this point in the history
  • Loading branch information
gregmagolan authored Feb 2, 2023
1 parent 2566299 commit 3fee9c2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .bcr/source.template.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"integrity": "**leave this alone**",
"strip_prefix": "{REPO}-{VERSION}",
"url": "https://github.com/{OWNER}/{REPO}/archive/refs/tags/{TAG}.tar.gz"
"url": "https://github.com/{OWNER}/{REPO}/releases/download/{TAG}/rules_ts-{TAG}.tar.gz"
}
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ jobs:
# Bazelisk will download bazel to here
XDG_CACHE_HOME: ~/.cache/bazel-repo
run: bazel --bazelrc=.github/workflows/ci.bazelrc --bazelrc=.bazelrc test //...
- name: Prepare workspace snippet
run: .github/workflows/workspace_snippet.sh ${{ env.GITHUB_REF_NAME }} > release_notes.txt
- name: Prepare release
run: .github/workflows/release_prep.sh ${{ env.GITHUB_REF_NAME }} > release_notes.txt
- name: Release
uses: softprops/action-gh-release@v1
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ set -o errexit -o nounset -o pipefail
TAG=${GITHUB_REF_NAME}
# Strip leading 'v'
PREFIX="rules_ts-${TAG:1}"
SHA=$(git archive --format=tar --prefix=${PREFIX}/ ${TAG} | gzip | shasum -a 256 | awk '{print $1}')
ARCHIVE="rules_ts-$TAG.tar.gz"

git archive --format=tar --prefix=${PREFIX}/ ${TAG} | gzip > $ARCHIVE
SHA=$(shasum -a 256 $ARCHIVE | awk '{print $1}')

cat << EOF
## Using [Bzlmod] with Bazel 6:
Expand Down Expand Up @@ -40,7 +43,7 @@ http_archive(
name = "aspect_rules_ts",
sha256 = "${SHA}",
strip_prefix = "${PREFIX}",
url = "https://github.com/aspect-build/rules_ts/archive/refs/tags/${TAG}.tar.gz",
url = "https://github.com/aspect-build/rules_ts/releases/download/${TAG}/${ARCHIVE}",
)
EOF

Expand Down

0 comments on commit 3fee9c2

Please sign in to comment.