From fffa3658380ee88f9a9935ea67ab92fea6e33058 Mon Sep 17 00:00:00 2001 From: sanfrancrisko Date: Mon, 25 Oct 2021 17:56:30 +0100 Subject: [PATCH 1/4] (MAINT) Add 0.5.0 heading in CHANGELOG --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a6ce194e..e072b128 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] - +## [0.5.0] ### Added - [(GH-222)](https://github.com/puppetlabs/pdkgo/issues/222) Telemetry to the binary, which will report the operating system type and architecture when a command is run; the implementation allows for two binaries: one with telemetry configured and enabled, and one _without_ the telemetry included at all. @@ -72,6 +72,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [(GH-29)](https://github.com/puppetlabs/pdkgo/issues/29) Error if template not found [Unreleased]: https://github.com/puppetlabs/pdkgo/compare/0.4.0..main +[0.5.0]: https://github.com/puppetlabs/pdkgo/releases/tag/0.5.0 [0.4.0]: https://github.com/puppetlabs/pdkgo/releases/tag/0.4.0 [0.3.0]: https://github.com/puppetlabs/pdkgo/releases/tag/0.3.0 [0.2.0]: https://github.com/puppetlabs/pdkgo/releases/tag/0.2.0 From f0a22bd35e009d9bbe71ccf1db2ddc543e9fa1e3 Mon Sep 17 00:00:00 2001 From: sanfrancrisko Date: Mon, 25 Oct 2021 18:16:02 +0100 Subject: [PATCH 2/4] (MAINT) Fix `install.sh` checksum calc to handle notel pkg sums Prior to this commit, the `grep` command that extracted the package checksum from `pct_checksums.txt` was too greedy, and matched on both the `pct` and `notel_pct` packages, causing an error after `0.5.0` was released, which contained the notel package was made available This commit adds a space prior to the package name, so `notel_` is not picked up in the match too. --- tools/install.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/install.sh b/tools/install.sh index 0860379b..81370dcd 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -18,7 +18,6 @@ fi RELEASES="" FILE="" -VER="" CHECKSUM="" logDebug() { @@ -38,7 +37,7 @@ getChecksums() { echo "Fetching checksums.txt failed on attempt ${i}, retrying..." sleep 5 else - CHECKSUM=$(grep ${FILE} /tmp/pct_checksums.txt | cut -d ' ' -f 1) + CHECKSUM=$(grep " ${FILE}" /tmp/pct_checksums.txt | cut -d ' ' -f 1) return 0 fi done From f3309339b929c724caf6d3dcf867e37538d1d564 Mon Sep 17 00:00:00 2001 From: sanfrancrisko Date: Mon, 25 Oct 2021 18:51:12 +0100 Subject: [PATCH 3/4] (MAINT) Add `RELEASE.md` --- RELEASE.md | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 RELEASE.md diff --git a/RELEASE.md b/RELEASE.md new file mode 100644 index 00000000..18960928 --- /dev/null +++ b/RELEASE.md @@ -0,0 +1,72 @@ +# Releasing a New Version + +We use [`goreleaser`](https://github.com/goreleaser/goreleaser) to release new packages. +Once the commit we want to release at, is tagged, the [release workflow](https://github.com/puppetlabs/pdkgo/blob/main/.github/workflows/release.yml) executes, which will: +- Generate the build artefacts +- Create a new [release](https://github.com/puppetlabs/pdkgo/releases) in Github + +## Create and merge release prep PR + +- Create a new branch from `puppetlabs/main` called `maint/main/release_prep_` (e.g. `maint/main/release_prep_0.5.0`) +- Ensure the `CHANGELOG` is up-to-date and contains entries for any user visible new features / bugfixes. This should have been added as part of each ticket's work, but sometimes things are missed: + +>> Compare the changes between `main` and the latest release tag: +>> +>> For example: https://github.com/puppetlabs/pdkgo/compare/0.5.0..main + +- Rename `[Unreleased]` to the version we are releasing and create a new `[Unreleased]` header at the top of the `CHANGELOG`: + +```md +## [Unreleased] + +## [0.5.0] + +- [(GH-123)](https://github.com/puppetlabs/pdkgo/issues/123) New feature in 0.5.0 +- [(GH-567)](https://github.com/puppetlabs/pdkgo/issues/567) Bug fix in 0.5.0 +``` + +- Update the links at the bottom of the `CHANGELOG` with the new release version and update the `[Unreleased]` tag to compare from the version we're releasing now against `main`: + +```md +[Unreleased]: https://github.com/puppetlabs/pdkgo/compare/0.5.0..main +[0.5.0]: https://github.com/puppetlabs/pdkgo/releases/tag/0.5.0 +[0.4.0]: https://github.com/puppetlabs/pdkgo/releases/tag/0.4.0 +... +``` + +- Add and commit these changes +- Create a PR against `main`: + - Tag: `maintenance` +- Wait for the tests to pass +- Request a colleage to review and merge + +## Tag merge commit + +After the release prep PR has been merged, perform a `git fetch` and `git pull` and ensure you are on the merged commit of the release prep that has just landed in [`puppetlabs:main`](https://github.com/puppetlabs/pdkgo/commits/main). + +Tag the merged commit and push to `puppetlabs`: + +```sh +git tag -a -m "PCT " +git push +``` + +For example, assuming: +- **Locally configured remote repo name for `puppetlabs`:** `origin` +- **Version:** `0.5.0` + +```sh +git tag -a 0.5.0 -m "PCT 0.5.0" +git push origin 0.5.0 +``` + +This should trigger the [release worfklow](https://github.com/puppetlabs/pdkgo/actions/workflows/release.yml) to perform the release. +Ensure the workflow completes, then move on to the final steps. + +## Perform post release installation tests + +- Ensure that there is a new release for the version we tagged in [Releases](https://github.com/puppetlabs/pdkgo/releases), with: + - The correct version + - The expected number of build artefacts +- Perform a quick test locally to ensure that the [installation instructions in the README](https://github.com/puppetlabs/pdkgo/blob/main/README.md#installing) work and that the latest version is installed on your local system / test system +- Repeat the above steps for the [Telemetry free version](https://github.com/puppetlabs/pdkgo/blob/main/README.md#installing-telemetry-free-version) From a5b24669f3f77659c8c90dd8aeaf4339a34eaed2 Mon Sep 17 00:00:00 2001 From: sanfrancrisko Date: Tue, 26 Oct 2021 10:24:53 +0100 Subject: [PATCH 4/4] (MAINT) Fix typo in installation.yml --- .github/workflows/installation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/installation.yml b/.github/workflows/installation.yml index da2f57ae..ec2e19d8 100644 --- a/.github/workflows/installation.yml +++ b/.github/workflows/installation.yml @@ -25,7 +25,7 @@ jobs: Where-Object { $_ -match '^\d+\.\d+\.\d+$' } | Sort-Object -Descending | Select-Object -First 1 - echo "::set-output name=tag::0.4.0 d18bd02" + echo "::set-output name=tag::$TagVersion" - name: Install PCT (Windows) if: runner.os == 'Windows' shell: pwsh