diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 96730d93..216bff7f 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -47,15 +47,30 @@ jobs: mkdir -p _dist cp ./deployments/workloads/runtime.yaml _dist/runtime.yaml cp ./deployments/workloads/workload.yaml _dist/workload.yaml - + + - name: extract changelog + run: | + TAG_NAME=${GITHUB_REF#refs/tags/} + cd $GITHUB_WORKSPACE + ./scripts/extract-changelog.sh $TAG_NAME > RELEASE_NOTES.md + cat RELEASE_NOTES.md + - name: create release if: startsWith(github.ref, 'refs/tags/v') env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | + TAG_NAME=${GITHUB_REF#refs/tags/} + if [[ "$TAG_NAME" =~ .+-pre.* ]]; then + PRERELEASE_ARGS="--prerelease --latest=false" + else + PRERELEASE_ARGS="" + fi gh release create ${{ env.RELEASE_VERSION }} \ - --generate-notes \ - -p \ + --notes-file RELEASE_NOTES.md \ + --title ${{ env.RELEASE_VERSION }} \ + --verify-tag + $PRERELEASE_ARGS \ _dist/runtime.yaml#example-runtimes \ _dist/workload.yaml#example-workloads \ diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..172d4833 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,30 @@ +# Changelog + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] - YYYY-MM-DD + +### Added + +- Added MQTT trigger and tests ([#175](https://github.com/spinkube/containerd-shim-spin/pull/175)) +- Make container environment variables accessible as application variables ([#149](https://github.com/spinkube/containerd-shim-spin/pull/149)) +- Added feature to conditionally restart the k0s controller service when present during node installation. ([#167](https://github.com/spinkube/containerd-shim-spin/pull/167)) + +### Changed + +- Updated the minimum required Rust version to 1.79 ([#191](https://github.com/spinkube/containerd-shim-spin/pull/191)) +- Refactored the shim code by splitting it into different modules ([#185](https://github.com/spinkube/containerd-shim-spin/pull/185)) +- Refactored the Makefile to improve its structure and comments([#171](https://github.com/spinkube/containerd-shim-spin/pull/171)) +- Merged two Redis trigger test apps into one ([#176](https://github.com/spinkube/containerd-shim-spin/pull/176)) +- Simplified the run command in the documentation ([#184](https://github.com/spinkube/containerd-shim-spin/pull/184)) +- Modified Dependabot settings to group patch-level dependency updates ([#162](https://github.com/spinkube/containerd-shim-spin/pull/162)) + +### Fixed + +- Correct currently supported triggers ([#182](https://github.com/spinkube/containerd-shim-spin/pull/182)) +- Fixed an error in `setup-linux.sh` script ([#184](https://github.com/spinkube/containerd-shim-spin/pull/184)) +- Updated outdated links to `spinkube.dev` ([#170](https://github.com/spinkube/containerd-shim-spin/pull/170)) + +--- + +[Unreleased]: https://github.com/spinkube/containerd-shim-spin/compare/v0.15.1...HEAD \ No newline at end of file diff --git a/release.md b/release.md index 59df5aed..aa90a78b 100644 --- a/release.md +++ b/release.md @@ -8,14 +8,21 @@ following: commit selected to be tagged and released. 1. Change all references of the version number in package - [Cargo.toml](./Cargo.toml), crate - [Cargo.toml](./containerd-shim-spin/Cargo.toml), - [quickstart](./containerd-shim-spin/quickstart.md), [README](./README.md), - [deployments](./deployments/), and [images](./images/). Run `cargo build + + * [Cargo.toml](./Cargo.toml), + * crate [Cargo.toml](./containerd-shim-spin/Cargo.toml), + * [quickstart](./containerd-shim-spin/quickstart.md), + * [README](./README.md), + * [deployments](./deployments/), + * [images](./images/). + * [CHANGELOG.md](./CHANGELOG.md) the Unreleased section should be updated with the new version number and the date of the release. Update the links to new version tag in the footer of CHANGELOG.md + + Run `cargo build --release` to make sure lockfiles reflect Cargo.toml updates. Add a new column to the [README shim and Spin version map](./README.md#shim-and-spin-version-map) that lists the version of the Spin dependencies for the release. + 1. Create a pull request with these changes and merge once approved. diff --git a/scripts/extract-changelog.sh b/scripts/extract-changelog.sh new file mode 100755 index 00000000..58b1c5e2 --- /dev/null +++ b/scripts/extract-changelog.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# Inspired by https://stackoverflow.com/questions/40450238/parse-a-changelog-and-extract-changes-for-a-version +# This script will extract the changelog for a specific version from the CHANGELOG.md file +# Usage: ./extract-changelog.sh +version=$1 + +awk -v ver="$version" ' +/^## \[.*\]/ { + if (p) exit + if ($0 ~ "^## \\[" ver "\\]") { p=1; next } +} +p' CHANGELOG.md \ No newline at end of file