Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: prepare 6.8.2 release #271

Merged
merged 5 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/user-agent.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Lint
on:
pull_request:
paths:
- CHANGELOG.md
jobs:
update_user_agent:
name: Check version in User-Agent
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: ./scripts/update-user-agent-version.sh
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "chore: update version in `User-Agent`"
file_pattern: upcloud/client/client.go
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file.
See updating [Changelog example here](https://keepachangelog.com/en/1.0.0/)

## [Unreleased]
## [6.8.2]
### Added
- account: `NetworkPeerings`, `NTPExcessGiB`, `StorageMaxIOPS`, and `LoadBalancers` fields to the `ResourceLimits` struct.

Expand Down
2 changes: 1 addition & 1 deletion RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
1. Add new heading with the correct version e.g. `## [6.7.0]`
2. Update links at the bottom of the page
3. Leave `## Unreleased` section at the top empty
4. Update `Version` in [upcloud/client/client.go](./upcloud/client/client.go)
4. Check that `Version` in [upcloud/client/client.go](./upcloud/client/client.go) is up-to-date. The value is automatically updated by GitHub Actions.
5. Test GoReleaser config with `goreleaser check`
6. Tag a commit with the version you want to release e.g. `v6.7.0`
7. Push the tag & commit to GitHub
Expand Down
16 changes: 16 additions & 0 deletions scripts/update-user-agent-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/sh -x
# This script should work on Ubuntu sh. On other systems (e.g., alpine or macOS) there might be differences in echo and sed commands that can cause unexpected changes.

version_re="[0-9]+\.[0-9]+\.[0-9]+"

changelog=$(grep -E -m 1 "##.*$version_re.*" CHANGELOG.md | grep -Eo "$version_re");
user_agent=$(grep -E -m 1 "Version.*$version_re.*" upcloud/client/client.go | grep -Eo "$version_re")

if [ "$changelog" = "$user_agent" ]; then
exit 0;
fi;

latest=$(echo "$changelog\n$user_agent" | sort -V | tail -n1)

sed -Ei "s/(##.*)$changelog(.*)/\1$latest\2/" CHANGELOG.md;
sed -Ei "s/(.*Version.*\")$user_agent(\".*)/\1$latest\2/" upcloud/client/client.go;
2 changes: 1 addition & 1 deletion upcloud/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
)

const (
Version string = "6.8.1"
Version string = "6.8.2"
APIVersion string = "1.3"
APIBaseURL string = "https://api.upcloud.com"

Expand Down
Loading