-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Release 0.10.0 #433
Merged
Release 0.10.0 #433
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
0ce5e53
Add a minimal core test module for the BCR.
aherrmann 7f96746
Add add to BCR configuration
aherrmann b9b626a
Add changelog
aherrmann e424e17
Bump version 0.9.0 --> 0.10.0
aherrmann 367b4a9
BCR config - use release artifact
aherrmann 52e8811
Configure automatic release action
aherrmann 14cea05
git tag --cleanup flag
aherrmann cd02f54
Allow calling CI workflow
aherrmann d31da9f
fix workflow reference
aherrmann 39a6c76
Clean up release setup instructions
aherrmann 45c1d3b
Add bzlmod config to core/testing
aherrmann a0c4646
fix testing registry
aherrmann 95ca39b
Extract section from changelog
aherrmann 687a91c
Merge branch 'master' into bcr-test
mergify[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,2 @@ | ||
moduleRoots: | ||
- "core" |
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,20 @@ | ||
{ | ||
"homepage": "https://nix-bazel.build", | ||
"maintainers": [ | ||
{ | ||
"email": "[email protected] ", | ||
"github": "benradf", | ||
"name": "Benjamin Radford" | ||
}, | ||
{ | ||
"email": "[email protected]", | ||
"github": "aherrmann", | ||
"name": "Andreas Herrmann" | ||
} | ||
], | ||
"repository": [ | ||
"github:tweag/rules_nixpkgs" | ||
], | ||
"versions": [], | ||
"yanked_versions": [] | ||
} |
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,15 @@ | ||
bcr_test_module: | ||
module_path: "testing" | ||
matrix: | ||
platform: ["ubuntu2204"] | ||
tasks: | ||
run_tests: | ||
name: "Run test module" | ||
platform: ${{ platform }} | ||
shell_commands: | ||
- apt update | ||
- apt install --yes nix-setup-systemd | ||
- nix-channel --add https://nixos.org/channels/nixpkgs-unstable nixpkgs | ||
- nix-channel --update | ||
test_targets: | ||
- "//..." |
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,5 @@ | ||
{ | ||
"integrity": "", | ||
"strip_prefix": "{REPO}-{VERSION}/core", | ||
"url": "https://github.com/{OWNER}/{REPO}/releases/download/{TAG}/${REPO}-${VERSION}.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
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,46 @@ | ||
# Cut a release whenever a new tag is pushed to the repo. | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*.*.*" | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
tests: | ||
# Do only release when CI succeeds. | ||
uses: ./.github/workflows/workflow.yaml | ||
|
||
release: | ||
# Do only release when CI succeeds. | ||
needs: [tests] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Get version number | ||
id: get-version | ||
run: set -x; echo "version=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT | ||
- name: Read section from CHANGELOG.md | ||
id: extract-changelog | ||
uses: sean0x42/markdown-extract@v2 | ||
with: | ||
file: CHANGELOG.md | ||
pattern: ${{ steps.get-version.outputs.version }} | ||
- name: Prepare release notes and artifacts | ||
run: | | ||
.github/workflows/release_prep.sh ${{ env.GITHUB_REF_NAME }} > release_notes.txt | ||
printf '${{ steps.extract-changelog.outputs.markdown }}' >> 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 | ||
body_path: release_notes.txt | ||
fail_on_unmatched_files: true | ||
files: rules_nixpkgs*-*.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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
# Set by GH actions, see | ||
# https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables | ||
TAG=${GITHUB_REF_NAME} | ||
# The prefix is chosen to match what GitHub generates for source archives | ||
PREFIX="rules_nixpkgs-${TAG:1}" | ||
ARCHIVE="rules_nixpkgs-${TAG:1}.tar.gz" | ||
git archive --format=tar.gz --prefix="${PREFIX}/" -o $ARCHIVE ${TAG} | ||
SHA=$(shasum -a 256 "$ARCHIVE" | awk '{print $1}') | ||
|
||
cat << EOF | ||
benradf marked this conversation as resolved.
Show resolved
Hide resolved
|
||
## 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_nixpkgs_core", version = "${TAG:1}") | ||
\`\`\` | ||
|
||
## Using WORKSPACE | ||
|
||
Paste this snippet into your \`WORKSPACE.bazel\` file: | ||
|
||
\`\`\`starlark | ||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | ||
|
||
http_archive( | ||
name = "io_tweag_rules_nixpkgs", | ||
sha256 = "${SHA}", | ||
strip_prefix = "$PREFIX", | ||
urls = ["https://github.com/tweag/rules_nixpkgs/releases/download/$TAG/$ARCHIVE"], | ||
) | ||
|
||
load("@io_tweag_rules_nixpkgs//nixpkgs:repositories.bzl", "rules_nixpkgs_dependencies") | ||
|
||
rules_nixpkgs_dependencies() | ||
|
||
load("@io_tweag_rules_nixpkgs//nixpkgs:nixpkgs.bzl", "nixpkgs_git_repository", "nixpkgs_package", "nixpkgs_cc_configure") | ||
|
||
load("@io_tweag_rules_nixpkgs//nixpkgs:toolchains/go.bzl", "nixpkgs_go_configure") # optional | ||
\`\`\` | ||
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
bazel-* | ||
testing |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Note, this file cannot load the .bazelrc file in rules_nixpkgs, because it | ||
# needs to work from an extraction of rules_nixpkgs_core only. | ||
|
||
build --host_platform=@rules_nixpkgs_core//platforms:host | ||
|
||
common:bzlmod --enable_bzlmod | ||
|
||
# User Configuration | ||
# ------------------ | ||
try-import %workspace%/.bazelrc.local | ||
|
||
# vim: ft=conf |
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,14 @@ | ||
load("@bazel_skylib//rules:diff_test.bzl", "diff_test") | ||
|
||
genrule( | ||
name = "hello.actual", | ||
cmd = "$(execpath @hello//:bin/hello) > $(OUTS)", | ||
tools = ["@hello//:bin/hello"], | ||
outs = ["hello.actual.txt"], | ||
) | ||
|
||
diff_test( | ||
name = "test", | ||
file1 = ":hello.actual.txt", | ||
file2 = ":hello.expected.txt", | ||
) |
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,13 @@ | ||
module(name = "rules_nixpkgs_core_bcr_testing") | ||
|
||
bazel_dep(name = "rules_nixpkgs_core") | ||
local_path_override( | ||
module_name = "rules_nixpkgs_core", | ||
path = "..", | ||
) | ||
|
||
nix_pkg = use_extension("@rules_nixpkgs_core//extensions:package.bzl", "nix_pkg") | ||
nix_pkg.default(attr = "hello") | ||
use_repo(nix_pkg, "hello") | ||
|
||
bazel_dep(name = "bazel_skylib", version = "1.4.2") |
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,6 @@ | ||
This is a minimal test module for rules_nixpkgs_core intended for [Bazel CI | ||
testing][bcr-test-module] on the Bazel Central Registry. | ||
|
||
More in-depth testing is performed in rules_nixpkgs/testing/core. | ||
|
||
[bcr-test-module]: https://github.com/bazelbuild/bazel-central-registry/blob/main/docs/README.md#test-module |
Empty file.
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 @@ | ||
Hello, world! |
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
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
|
@@ -12,6 +12,6 @@ | |
"name": "Andreas Herrmann" | ||
} | ||
], | ||
"versions": ["0.9.0"], | ||
"versions": ["0.10.0"], | ||
"yanked_versions": [] | ||
} |
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,8 +1,8 @@ | ||
module( | ||
name = "rules_nixpkgs_cc", | ||
version = "0.9.0", | ||
version = "0.10.0", | ||
) | ||
|
||
bazel_dep(name = "rules_nixpkgs_core", version = "0.9.0") | ||
bazel_dep(name = "rules_nixpkgs_core", version = "0.10.0") | ||
bazel_dep(name = "bazel_skylib", version = "1.0.3") | ||
bazel_dep(name = "rules_cc", version = "0.0.1") |
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,9 +1,9 @@ | ||
module( | ||
name = "rules_nixpkgs_go", | ||
version = "0.9.0", | ||
version = "0.10.0", | ||
) | ||
|
||
bazel_dep(name = "rules_nixpkgs_core", version = "0.9.0") | ||
bazel_dep(name = "rules_nixpkgs_core", version = "0.10.0") | ||
bazel_dep(name = "rules_go", repo_name = "io_bazel_rules_go", version = "0.39.1") | ||
bazel_dep(name = "bazel_skylib", version = "1.0.3") | ||
bazel_dep(name = "platforms", version = "0.0.4") |
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,8 +1,8 @@ | ||
module( | ||
name = "rules_nixpkgs_java", | ||
version = "0.9.0", | ||
version = "0.10.0", | ||
) | ||
|
||
bazel_dep(name = "rules_nixpkgs_core", version = "0.9.0") | ||
bazel_dep(name = "rules_nixpkgs_core", version = "0.10.0") | ||
bazel_dep(name = "rules_java", version = "4.0.0") | ||
bazel_dep(name = "bazel_skylib", version = "1.0.3") |
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,8 +1,8 @@ | ||
module( | ||
name = "rules_nixpkgs_nodejs", | ||
version = "0.9.0", | ||
version = "0.10.0", | ||
) | ||
|
||
bazel_dep(name = "rules_nixpkgs_core", version = "0.9.0") | ||
bazel_dep(name = "rules_nixpkgs_core", version = "0.10.0") | ||
bazel_dep(name = "rules_nodejs", version = "5.5.3") | ||
bazel_dep(name = "bazel_skylib", version = "1.0.3") |
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,8 +1,8 @@ | ||
module( | ||
name = "rules_nixpkgs_posix", | ||
version = "0.9.0", | ||
version = "0.10.0", | ||
) | ||
|
||
bazel_dep(name = "rules_nixpkgs_core", version = "0.9.0") | ||
bazel_dep(name = "rules_nixpkgs_core", version = "0.10.0") | ||
bazel_dep(name = "rules_sh", version = "0.3.0") | ||
bazel_dep(name = "bazel_skylib", version = "1.0.3") |
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,7 +1,7 @@ | ||
module( | ||
name = "rules_nixpkgs_python", | ||
version = "0.9.0", | ||
version = "0.10.0", | ||
) | ||
|
||
bazel_dep(name = "rules_nixpkgs_core", version = "0.9.0") | ||
bazel_dep(name = "rules_nixpkgs_core", version = "0.10.0") | ||
bazel_dep(name = "bazel_skylib", version = "1.0.3") |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not use
https://github.com/tweag/rules_nixpkgs/archive/refs/tags/v0.10.0.tar.gz
which is available by default?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The short version is that these automatically generated artifacts are not guaranteed to be bit-wise reproducible. But, Bazel uses sha256 to ensure that the downloaded artifact was not tampered with or otherwise damaged. So, any bit-change in the artifact would change the sha256 and cause a failure. So, instead, the recommendation is that Bazel rules produce dedicated release artifacts, which are guaranteed to stay the same.
See also the discussion here: bazel-contrib/SIG-rules-authors#11
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome, thank you!