-
-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prepare for releasing rules_jsonnet 0.6.0 (#187)
* Automate the release process This change imports a GitHub workflow that is similar to the one we have in rules_python that gets launched when new tags are created. We can use that to automatically perform releases on GitHub and attach a stable source tarball. Issue: #170 * Use zero version numbers in helper modules These will always use the very latest version of the source code that's present in this repository. There is no need to fill in an exact number here. * Bump the version number of the rules_jsonnet module to 0.6.0 I think that it makes sense to cut a new release of rules_jsonnet. First and foremost because this will be the first official release to support bzlmod. It also addresses the import path issue that prevents people from using these rules in multi-workspace environments.
- Loading branch information
1 parent
c74493b
commit 0dc6e87
Showing
6 changed files
with
104 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#!/usr/bin/env bash | ||
# Copyright 2024 The Bazel Authors. All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
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} | ||
# A prefix is added to better match the GitHub generated archives. | ||
PREFIX="rules_jsonnet-${TAG}" | ||
ARCHIVE="rules_jsonnet-$TAG.tar.gz" | ||
git archive --format=tar --prefix=${PREFIX}/ ${TAG} | gzip > $ARCHIVE | ||
SHA=$(shasum -a 256 $ARCHIVE | awk '{print $1}') | ||
|
||
cat > release_notes.txt << EOF | ||
## Setup | ||
To use the Jsonnet rules, add the following to your \`MODULE.bazel\` file: | ||
\`\`\`starlark | ||
bazel_dep(name = "rules_jsonnet", version = "${TAG}") | ||
\`\`\` | ||
If you are using an older version of Bazel that does not support Bzlmod, | ||
add the following to your \`WORKSPACE\` file to add the external | ||
repositories for Jsonnet: | ||
\`\`\`starlark | ||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | ||
http_archive( | ||
name = "io_bazel_rules_jsonnet", | ||
sha256 = "${SHA}", | ||
strip_prefix = "${PREFIX}", | ||
urls = ["https://github.com/bazelbuild/rules_jsonnet/releases/download/${TAG}/rules_jsonnet-${TAG}.tar.gz", | ||
) | ||
load("@io_bazel_rules_jsonnet//jsonnet:jsonnet.bzl", "jsonnet_repositories") | ||
jsonnet_repositories() | ||
load("@google_jsonnet_go//bazel:repositories.bzl", "jsonnet_go_repositories") | ||
jsonnet_go_repositories() | ||
load("@google_jsonnet_go//bazel:deps.bzl", "jsonnet_go_dependencies") | ||
jsonnet_go_dependencies() | ||
\`\`\` | ||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Copyright 2024 The Bazel Authors. All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# Cut a release whenever a new tag is pushed to the repo. | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*.*.*" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Create release archive and notes | ||
run: .github/workflows/create_archive_and_notes.sh | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
# Use GH feature to populate the changelog automatically | ||
generate_release_notes: true | ||
body_path: release_notes.txt | ||
fail_on_unmatched_files: true | ||
files: rules_python-*.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module( | ||
name = "rules_jsonnet", | ||
version = "0.5.0", | ||
version = "0.6.0", | ||
repo_name = "io_bazel_rules_jsonnet", | ||
) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters