-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #433 from tweag/bcr-test
Release 0.10.0
- Loading branch information
Showing
28 changed files
with
258 additions
and
21 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,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 | ||
## 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