Skip to content

Commit

Permalink
Merge pull request #565 from tweag/prepare-release-0.12
Browse files Browse the repository at this point in the history
Prepare release 0.12.0
  • Loading branch information
avdv authored Jul 12, 2024
2 parents c7d568c + 007158d commit ef6a658
Show file tree
Hide file tree
Showing 39 changed files with 189 additions and 72 deletions.
3 changes: 2 additions & 1 deletion .bcr/core/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ bcr_test_module:
module_path: "testing"
matrix:
platform: ["ubuntu2204"]
bazel: ["6.4.0"]
bazel:
- "6.x"
tasks:
run_tests:
name: "Run test module"
Expand Down
20 changes: 20 additions & 0 deletions .bcr/nodejs/metadata.template.json
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": {}
}
19 changes: 19 additions & 0 deletions .bcr/nodejs/presubmit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
bcr_test_module:
module_path: "testing"
matrix:
platform: ["ubuntu2204"]
bazel:
- "6.x"
tasks:
run_tests:
name: "Run test module"
platform: ${{ platform }}
bazel: ${{ bazel }}
environment:
# The Nix installer updates ~/.profile to set PATH. However, the Bazel
# CI setup seems to disregard ~/.profile. So we set PATH manually here.
PATH: /var/lib/buildkite-agent/.nix-profile/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
shell_commands:
- curl -L https://nixos.org/nix/install | sh -s -- --no-daemon
test_targets:
- "//..."
5 changes: 5 additions & 0 deletions .bcr/nodejs/source.template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"integrity": "",
"strip_prefix": "{REPO}-{VERSION}/toolchains/nodejs",
"url": "https://github.com/{OWNER}/{REPO}/releases/download/{TAG}/{REPO}-{VERSION}.tar.gz"
}
41 changes: 41 additions & 0 deletions .github/ISSUE_TEMPLATE/release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
name: Prepare new release (for maintainers only)
title: Prepare release MAJOR.MINOR.PATCH
about: Steps to work through in order to publish a new release

---

- [ ] Read through this process in its entirety so you understand it.
- [ ] Create and checkout a new release preparation branch, named
`release-<major>.<minor>.<patch>`.
- [ ] If the minimal Bazel version has changed:
- [ ] update it in [the `README`][readme] and in `presubmit.yml` files from the `.bcr` folder
- [ ] add a note about this change to the [`CHANGELOG`][changelog]
- [ ] List user facing changes in the [`CHANGELOG`][changelog] by summarising all significant
pull requests since the last release. Specifically:
- Add a "Highlights" section for major improvements/changes.
- Create "Added", "Removed", "Changed" and "Fixed" sections, as necessary.
- If relevant, add links to the corresponding PRs to the entries.
- Look through:
* [merged PRs](https://github.com/tweag/rules_nixpkgs/pulls?q=is:pr+base:master+merged:>2023-10-18+-author:app/github-actions+-author:app/dependabot) or
* `git log master ^v0.x.x --oneline --merges --grep='pull request' --grep='#' | grep -v 'tweag/dependabot/github_actions/' | grep -v 'tweag/update_flake_lock_action'`
- [ ] Bump version numbers in `MODULE.bazel` and the registry, rename files
```
grep '0.10.0 -r --exclude-dir=.git lists occurences of 0.10.0 in files
find -path ./.git -prune -o -name '*0.10.0*' -print lists occurences of 0.10.0 in names
```
- [ ] Push the `release-<major>.<minor>.<patch>` branch and open a PR,
go through review and merge upon success.
- [ ] Trigger the `Prepare Release` workflow
- either via the Github UI **or**
- run `gh workflow run -f version=<major>.<minor>.<patch> 'Prepare Release'` using the Github CLI
- [ ] Go to the [releases], open the draft release which was created to inspect it
- Do the code snippets look valid?
- Is there a release artifact attached to it?
- If you're happy, publish the release... :rocket:
- [ ] Announce the new version on Twitter by asking someone with access.
[changelog]: /CHANGELOG.md
[readme]: /README.md
[releases]: https://github.com/tweag/rules_nixpkgs/releases
4 changes: 2 additions & 2 deletions .github/build-and-test
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ if [[ ${BZLMOD_ENABLED-} = true ]]; then
)
declare -ra test_dirs=(
core/testing
toolchains/nodejs/testing
testing/core
testing/core/tests/intermediate_module
testing/go-bzlmod
testing/java
testing/nodejs
testing/posix
testing/rust
testing/python
Expand All @@ -62,10 +62,10 @@ else
toolchains/posix
toolchains/rust
toolchains/nodejs
toolchains/nodejs/testing
testing/core
testing/go-workspace
testing/java
testing/nodejs
testing/posix
testing/rust
testing/python
Expand Down
50 changes: 24 additions & 26 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,46 +1,44 @@
# Cut a release whenever a new tag is pushed to the repo.
name: Release
# Create a draft release when triggered via Github's UI or Github CLI
name: Prepare Release

on:
push:
tags:
- "v*.*.*"
workflow_dispatch:
inputs:
version:
description: 'Version to release (e.g. 0.11.0)'
required: true
type: string

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]
name: Prepare Release
runs-on: ubuntu-latest
steps:
- name: Check version
run: |
if ! [[ '${{ inputs.version }}' =~ ^[0-9]+[.][0-9]+[.][0-9]+$ ]]; then
echo '${{ inputs.version }} does not match expected format `major.minor.patch`' >&2
exit 1
fi
- name: Checkout
uses: actions/checkout@v4
- name: Get version number
id: get-version
run: set -x; echo "version=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
with:
ref: master # only create releases from main branch
- name: Read section from CHANGELOG.md
id: extract-changelog
uses: sean0x42/markdown-extract@v2
with:
file: CHANGELOG.md
pattern: ${{ steps.get-version.outputs.version }}
pattern: ${{ inputs.version }}
- name: Prepare release notes and artifacts
run: |
.github/workflows/release_prep.sh ${{ env.GITHUB_REF_NAME }} > release_notes.txt
.github/workflows/release_prep.sh v${{ inputs.version }} > release_notes.txt
printf '${{ steps.extract-changelog.outputs.markdown }}' >> release_notes.txt
- name: Release
uses: softprops/action-gh-release@v2
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
- name: Create draft release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create --draft --notes-file release_notes.txt v${{ inputs.version }} rules_nixpkgs-${{ inputs.version }}.tar.gz
8 changes: 3 additions & 5 deletions .github/workflows/release_prep.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
#!/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}
TAG=$1
# 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}')
git archive --format=tar.gz --prefix="${PREFIX}/" -o $ARCHIVE HEAD
SHA=$(shasum -a 256 "$ARCHIVE" | awk '{print $TAG}')

cat << EOF
## Using Bzlmod with Bazel 6
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@ jobs:
--keep BZLMOD_ENABLED \
--keep BAZEL_NIX_REMOTE \
--run 'bash .github/build-and-test'
- name: Setup tmate session
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
test-examples:
name: Build & Test - Examples
strategy:
Expand Down
37 changes: 36 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,42 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).

## [Unreleased]

[Unreleased]: https://github.com/tweag/rules_nixpkgs/compare/v0.11.0...HEAD
[Unreleased]: https://github.com/tweag/rules_nixpkgs/compare/v0.12.0...HEAD

## [0.12.0] - 2024-07-12

[0.12.0]: https://github.com/tweag/rules_nixpkgs/compare/v0.11.1...v0.12.0

### Added

- Make the C++ -std flag configurable. See [#557].
- Add module extension for nodejs toolchain. See [#505].
- Add bzlmod version of example to the guide. See [#556].

### Changed

- Update to Bazel 6. See [#503].
- Update the rules_nixpkgs guide. See [#554].

### Fixed

- Make `rules_nixpkgs_java` depend on `remote_java_tools` properly. See [#497].
- Catch case in which find_children is called on an empty dir by @numine777 in [#526]
- Make `nixpkgs_java_configure` work with Bazel 7. See [#499].
- Fix `java_test` failure with JDK 17+. See [#553].
- Fix CPU detection on Darwin with Bazel 7. See [#554].
- Fix cc toolchain on Darwin using nixpkgs >= 23.11. See [#543].

[#497]: https://github.com/tweag/rules_nixpkgs/pull/497
[#499]: https://github.com/tweag/rules_nixpkgs/pull/499
[#503]: https://github.com/tweag/rules_nixpkgs/pull/503
[#505]: https://github.com/tweag/rules_nixpkgs/pull/505
[#526]: https://github.com/tweag/rules_nixpkgs/pull/526
[#543]: https://github.com/tweag/rules_nixpkgs/pull/543
[#553]: https://github.com/tweag/rules_nixpkgs/pull/553
[#554]: https://github.com/tweag/rules_nixpkgs/pull/554
[#556]: https://github.com/tweag/rules_nixpkgs/pull/556
[#557]: https://github.com/tweag/rules_nixpkgs/pull/557

## [0.11.0] - 2024-03-27

Expand Down
6 changes: 3 additions & 3 deletions core/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module(
name = "rules_nixpkgs_core",
version = "0.11.1",
version = "0.12.0",
)

bazel_dep(name = "platforms", version = "0.0.4")
Expand All @@ -9,7 +9,7 @@ bazel_dep(name = "bazel_skylib", version = "1.0.3")
nix_repo = use_extension("//extensions:repository.bzl", "nix_repo")
nix_repo.github(
name = "nixpkgs",
tag = "22.11",
sha256 = "ddc3428d9e1a381b7476750ac4dbea7a42885cbbe6e1af44b21d6447c9609a6f",
tag = "24.05",
sha256 = "911314b81780f26fdaf87e17174210bdbd40c86bac1795212f257cdc236a1e78",
)
use_repo(nix_repo, "nixpkgs")
2 changes: 1 addition & 1 deletion docs/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module(
name = "rules_nixpkgs_docs",
version = "0.11.1",
version = "0.12.0",
)

bazel_dep(name = "rules_sh", version = "0.4.0")
Expand Down
3 changes: 2 additions & 1 deletion examples/cc-template/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# rules_nixpkgs guide template
rules_nixpkgs guide template
============================

A simple C++ project used as an example in the [rules_nixpkgs guide](../../guide.md): see there for more information.
2 changes: 1 addition & 1 deletion registry/modules/rules_nixpkgs_core/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
"name": "Andreas Herrmann"
}
],
"versions": ["0.11.1"],
"versions": ["0.12.0"],
"yanked_versions": []
}
4 changes: 0 additions & 4 deletions testing/nodejs/.bazelrc

This file was deleted.

1 change: 0 additions & 1 deletion testing/nodejs/flake.lock

This file was deleted.

1 change: 0 additions & 1 deletion testing/nodejs/nixpkgs.nix

This file was deleted.

4 changes: 2 additions & 2 deletions toolchains/cc/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module(
name = "rules_nixpkgs_cc",
version = "0.11.1",
version = "0.12.0",
)

bazel_dep(name = "rules_nixpkgs_core", version = "0.11.1")
bazel_dep(name = "rules_nixpkgs_core", version = "0.12.0")
bazel_dep(name = "bazel_skylib", version = "1.0.3")
bazel_dep(name = "rules_cc", version = "0.0.1")
4 changes: 2 additions & 2 deletions toolchains/go/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module(
name = "rules_nixpkgs_go",
version = "0.11.1",
version = "0.12.0",
)

bazel_dep(name = "rules_nixpkgs_core", version = "0.11.1")
bazel_dep(name = "rules_nixpkgs_core", version = "0.12.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")
4 changes: 2 additions & 2 deletions toolchains/java/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module(
name = "rules_nixpkgs_java",
version = "0.11.1",
version = "0.12.0",
)

bazel_dep(name = "rules_nixpkgs_core", version = "0.11.1")
bazel_dep(name = "rules_nixpkgs_core", version = "0.12.0")
bazel_dep(name = "rules_java", version = "7.3.1")
bazel_dep(name = "bazel_skylib", version = "1.0.3")

Expand Down
2 changes: 2 additions & 0 deletions toolchains/nodejs/.bazelignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bazel-*
testing
4 changes: 2 additions & 2 deletions toolchains/nodejs/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module(
name = "rules_nixpkgs_nodejs",
version = "0.11.1",
version = "0.12.0",
)

bazel_dep(name = "rules_nixpkgs_core", version = "0.11.1")
bazel_dep(name = "rules_nixpkgs_core", version = "0.12.0")
bazel_dep(name = "platforms", version = "0.0.4")
bazel_dep(name = "rules_nodejs", version = "5.5.3")
bazel_dep(name = "bazel_skylib", version = "1.0.3")
Expand Down
4 changes: 4 additions & 0 deletions toolchains/nodejs/testing/.bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import %workspace%/../../../.bazelrc.remote-cache
import %workspace%/../../../.bazelrc.common
import %workspace%/../../../.bazelrc.cc
import %workspace%/../../../.bazelrc.java
File renamed without changes.
Loading

0 comments on commit ef6a658

Please sign in to comment.