diff --git a/.bcr/presubmit.yml b/.bcr/presubmit.yml index f04fc6a5..4f7258c0 100644 --- a/.bcr/presubmit.yml +++ b/.bcr/presubmit.yml @@ -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" diff --git a/.bcr/source.template.json b/.bcr/source.template.json index 4f148199..902c2386 100644 --- a/.bcr/source.template.json +++ b/.bcr/source.template.json @@ -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" } diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9e6cd3b0..6d73599e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 diff --git a/.github/workflows/release_prep.sh b/.github/workflows/release_prep.sh index 6e41c74c..d4531660 100755 --- a/.github/workflows/release_prep.sh +++ b/.github/workflows/release_prep.sh @@ -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 @@ -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 "\`\`\`"