diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0cdda3cf..81d1a1ea 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -348,7 +348,8 @@ You can also remove your `$HOME/nix-installer-wsl-tests-temp` folder whenever yo This package uses [Semantic Versioning](https://semver.org/). When determining the version number for a new release refer to Semantic Versioning for guidance. You can use the `check-semver` command alias from within the development environment to validate your changes don't break semver. -To cut a release: +To cut a release, run `./prepare-release.sh 0.0.1`. +This script will: - Create a release branch from `main` (`git checkout -b release-v0.0.1`) - Release PRs should not contain any installer-related changes which require review @@ -356,13 +357,12 @@ To cut a release: - `nix flake update --commit-lock-file` - `cargo update --aggressive` - `cargo outdated --ignore-external-rel --aggressive` -- Ensure the VM / container tests still pass with the following: - - NOTE: At time of writing, these are run in CI on release branches +- Update the versions in the fixture data in `test/fixtures/**/*.json` +- Push the branch, create a PR ("Release v0.0.1"). + This pull request will automatically run VM and container tests: - `nix flake check -L` - `nix build .#hydraJobs.container-test.all.x86_64-linux.all -L -j 6` - `nix build .#hydraJobs.vm-test.all.x86_64-linux.all -L -j 6` -- Update the versions in the fixture data in `test/fixtures/**/*.json` -- Push the branch, create a PR ("Release v0.0.1") - Once the PR tests pass and it has been reviewed, merge it - Checkout the `main` branch and `git pull` - Prepare a draft release that creates the new tag on publish diff --git a/Cargo.lock b/Cargo.lock index ab322eae..6d573dd5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -131,9 +131,9 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "bitflags" -version = "2.7.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1be3f42a67d6d345ecd59f675f3f012d6974981560836e938c22b424b85ce1be" +checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" [[package]] name = "bumpalo" @@ -1074,7 +1074,7 @@ dependencies = [ [[package]] name = "nix-installer" -version = "0.33.0" +version = "0.34.0" dependencies = [ "async-trait", "bytes 1.9.0", diff --git a/Cargo.toml b/Cargo.toml index fdc8e60f..08e5eac3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "nix-installer" description = "The Determinate Nix Installer" -version = "0.33.0" +version = "0.34.0" edition = "2021" resolver = "2" license = "LGPL-2.1" diff --git a/flake.lock b/flake.lock index 4b6c883f..90cf0757 100644 --- a/flake.lock +++ b/flake.lock @@ -290,12 +290,12 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1736798957, - "narHash": "sha256-qwpCtZhSsSNQtK4xYGzMiyEDhkNzOCz/Vfu4oL2ETsQ=", - "rev": "9abb87b552b7f55ac8916b6fc9e5cb486656a2f3", - "revCount": 737779, + "lastModified": 1736883708, + "narHash": "sha256-uQ+NQ0/xYU0N1CnXsa2zghgNaOPxWpMJXSUJJ9W7140=", + "rev": "eb62e6aa39ea67e0b8018ba8ea077efe65807dc8", + "revCount": 738172, "type": "tarball", - "url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.737779%2Brev-9abb87b552b7f55ac8916b6fc9e5cb486656a2f3/019463c0-2408-72ce-9579-5965e6e5e05b/source.tar.gz" + "url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.738172%2Brev-eb62e6aa39ea67e0b8018ba8ea077efe65807dc8/01946c30-5ff9-7d30-acd1-28101cd9be64/source.tar.gz" }, "original": { "type": "tarball", diff --git a/flake.nix b/flake.nix index ce05de6f..d5331250 100644 --- a/flake.nix +++ b/flake.nix @@ -132,6 +132,7 @@ check.check-semver check.check-clippy editorconfig-checker + toml-cli ] ++ lib.optionals (pkgs.stdenv.isLinux) (with pkgs; [ checkpolicy diff --git a/prepare-release.sh b/prepare-release.sh new file mode 100755 index 00000000..d57c7485 --- /dev/null +++ b/prepare-release.sh @@ -0,0 +1,41 @@ +#!/bin/sh + +set -eux + +version=$1 + +if ! echo "$version" | grep -q "^[[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+$"; then + echo "argv[1] needs to be a version, in x.y.z format." + exit 1 +fi + +git fetch +git checkout origin/main +git checkout -B "release-v$version" + +nix flake update --commit-lock-file + +cargo update --aggressive +git add Cargo.lock +git commit -m "Update Cargo.lock dependencies" + +toml set ./Cargo.toml package.version "$version" > Cargo.toml.next +mv Cargo.toml.next Cargo.toml +git add Cargo.toml + +cargo fetch +git add Cargo.lock + +for fname in $(find ./tests/fixtures -name '*.json'); do + cat "$fname" \ + | jq '.version = $version | .diagnostic_data.version = $version' --arg version "$version" \ + > "$fname.next" + mv "$fname.next" "$fname" + git add "$fname" +done + +git commit -m "Release v$version" + +cargo outdated --ignore-external-rel --aggressive + +echo "Complete" diff --git a/tests/fixtures/linux/linux.json b/tests/fixtures/linux/linux.json index 6041f45e..29fffa5d 100644 --- a/tests/fixtures/linux/linux.json +++ b/tests/fixtures/linux/linux.json @@ -1,5 +1,5 @@ { - "version": "0.33.0", + "version": "0.34.0", "actions": [ { "action": { @@ -1164,7 +1164,7 @@ }, "diagnostic_data": { "attribution": null, - "version": "0.33.0", + "version": "0.34.0", "planner": "linux", "configured_settings": [], "os_name": "Ubuntu", diff --git a/tests/fixtures/linux/steam-deck.json b/tests/fixtures/linux/steam-deck.json index 01e1ee4e..1dee2aa4 100644 --- a/tests/fixtures/linux/steam-deck.json +++ b/tests/fixtures/linux/steam-deck.json @@ -1,5 +1,5 @@ { - "version": "0.33.0", + "version": "0.34.0", "actions": [ { "action": { @@ -1224,7 +1224,7 @@ }, "diagnostic_data": { "attribution": null, - "version": "0.33.0", + "version": "0.34.0", "planner": "steam-deck", "configured_settings": [], "os_name": "SteamOS", diff --git a/tests/fixtures/macos/macos.json b/tests/fixtures/macos/macos.json index 7b7085e4..6765363d 100644 --- a/tests/fixtures/macos/macos.json +++ b/tests/fixtures/macos/macos.json @@ -1,5 +1,5 @@ { - "version": "0.33.0", + "version": "0.34.0", "actions": [ { "action": { @@ -1266,7 +1266,7 @@ }, "diagnostic_data": { "attribution": null, - "version": "0.33.0", + "version": "0.34.0", "planner": "macos", "configured_settings": [], "os_name": "unknown",