Skip to content

Commit

Permalink
Merge pull request #143 from aherrmann/install-bcr-app
Browse files Browse the repository at this point in the history
chore: configure release automation
  • Loading branch information
aherrmann authored Dec 2, 2023
2 parents 975e776 + acd8fbb commit d1905c9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .bcr/presubmit.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
bcr_test_module:
module_path: "e2e/workspace"
matrix:
platform: ["ubuntu2004"] # ["debian10", "macos", "ubuntu2004", "windows"]
platform: ["ubuntu2204", "macos"] # ["debian10", "macos", "ubuntu2004", "windows"]
tasks:
run_tests:
name: "Run test module"
Expand Down
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": "",
"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}/{REPO}-{VERSION}.tar.gz"
}
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Prepare release notes and artifacts
run: .github/workflows/release_prep.sh ${{ env.GITHUB_REF_NAME }} > release_notes.txt
run: .github/workflows/release_prep.sh > release_notes.txt
- name: Release
uses: softprops/action-gh-release@v1
with:
draft: true
prerelease: true
# Use GH feature to populate the changelog automatically
generate_release_notes: true
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/release_prep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,21 @@ set -o errexit -o nounset -o pipefail
# Set by GH actions, see
# https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables
TAG=${GITHUB_REF_NAME}
VERSION=${TAG:1}
# The prefix is chosen to match what GitHub generates for source archives
PREFIX="rules_zig-${TAG:1}"
ARCHIVE="rules_zig-$TAG.tar.gz"
PREFIX="rules_zig-$VERSION"
ARCHIVE="$PREFIX.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
## Using Bzlmod with Bazel >=6
1. Enable with \`common --enable_bzlmod\` in \`.bazelrc\`.
2. Add to your \`MODULE.bazel\` file:
\`\`\`starlark
bazel_dep(name = "rules_zig", version = "${TAG:1}")
bazel_dep(name = "rules_zig", version = "$VERSION")
\`\`\`
## Using WORKSPACE
Expand All @@ -27,13 +28,14 @@ Paste this snippet into your `WORKSPACE.bazel` file:
\`\`\`starlark
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_zig",
sha256 = "${SHA}",
strip_prefix = "${PREFIX}",
url = "https://github.com/myorg/rules_zig/releases/download/${TAG}/${ARCHIVE}",
url = "https://github.com/aherrmann/rules_zig/releases/download/${TAG}/${ARCHIVE}",
)
EOF

awk 'f;/--SNIP--/{f=1}' e2e/workspace/WORKSPACE.bazel
echo "\`\`\`"
echo "\`\`\`"

0 comments on commit d1905c9

Please sign in to comment.