-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(publish): goreleaser action (#261)
- Loading branch information
1 parent
7dd13dd
commit 0e6f95a
Showing
4 changed files
with
127 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Publish | ||
on: | ||
push: | ||
tags: | ||
- 'v*.*.*' | ||
jobs: | ||
publish_release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout head | ||
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Get tag version | ||
id: git | ||
run: echo "tag_version=$(make version)" >> "$GITHUB_OUTPUT" | ||
- name: Get release notes | ||
id: release_notes | ||
run: make release-notes > .release_notes | ||
- name: Run goreleaser-action | ||
uses: goreleaser/goreleaser-action@336e29918d653399e599bfca99fadc1d7ffbc9f7 # v4.3.0 | ||
with: | ||
version: latest | ||
args: release --clean --release-notes=.release_notes | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# Make sure to check the documentation at https://goreleaser.com | ||
builds: | ||
- skip: true | ||
|
||
changelog: | ||
# Set this to true if you don't want any changelog at all. | ||
# | ||
# Warning: this will also ignore any changelog files passed via `--release-notes`, | ||
# and will render an empty changelog. | ||
# | ||
# This may result in an empty release notes on GitHub/GitLab/Gitea. | ||
# | ||
# Templates: allowed | ||
skip: false | ||
sort: asc | ||
filters: | ||
|
||
# Commit messages matching the regexp listed here will be removed from | ||
# the changelog | ||
exclude: | ||
- '^chore(docs)' | ||
- '^ci' | ||
|
||
release: | ||
# Repo in which the release will be created. | ||
# Default is extracted from the origin remote URL or empty if its private hosted. | ||
github: | ||
owner: UpCloudLtd | ||
name: upcloud-go-api | ||
|
||
# If set to true, will not auto-publish the release. | ||
# Available only for GitHub and Gitea. | ||
# | ||
# Default: false | ||
draft: true | ||
|
||
# Whether to remove existing draft releases with the same name before creating | ||
# a new one. | ||
# Only effective if `draft` is set to true. | ||
# Available only for GitHub. | ||
# | ||
# Default: false | ||
# Since: v1.11 | ||
replace_existing_draft: true | ||
|
||
# If set to auto, will mark the release as not ready for production | ||
# in case there is an indicator for this in the tag e.g. v1.0.0-rc1 | ||
# If set to true, will mark the release as not ready for production. | ||
# Default is false. | ||
prerelease: false | ||
|
||
# What to do with the release notes in case there the release already exists. | ||
# | ||
# Valid options are: | ||
# - `keep-existing`: keep the existing notes | ||
# - `append`: append the current release notes to the existing notes | ||
# - `prepend`: prepend the current release notes to the existing notes | ||
# - `replace`: replace existing notes | ||
# | ||
# Default is `keep-existing`. | ||
mode: keep-existing | ||
|
||
# You can change the name of the release. | ||
# | ||
# Default: '{{.Tag}}' ('{{.PrefixedTag}}' on Pro) | ||
# Templates: allowed | ||
name_template: "{{.Tag}}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,18 @@ | ||
# Releasing | ||
|
||
1. Merge all your changes to the stable branch | ||
1. If releasing a new major version, ensure that package name has been updated, e.g. if new version is `v6` package name in go.mod and every import should be `github.com/UpCloudLtd/upcloud-go-api/v6` | ||
1. Update CHANGELOG.md | ||
1. Add new heading with the correct version e.g. `## [v2.3.5]` | ||
1. Update links at the bottom of the page | ||
1. Leave “Unreleased” section at the top empty | ||
1. Update `Version` in [upcloud/client/client.go](./upcloud/client/client.go) | ||
1. Visit the repo [GitHub releases-page](https://github.com/UpCloudLtd/upcloud-go-api/releases) and draft a new release | ||
1. Tag the release `vX.Y.Z` (e.g. `v2.3.5`) | ||
1. Select the stable branch | ||
1. Title the release “vX.Y.Z” | ||
1. In the description of the release, paste the changes from CHANGELOG.md for this version release | ||
1. Publish the release when you are ready | ||
2. If releasing a new major version, ensure that package name has been updated, e.g. if new version is `v6` package name in go.mod and every import should be `github.com/UpCloudLtd/upcloud-go-api/v6` | ||
3. Update CHANGELOG.md | ||
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) | ||
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 | ||
- GitHub action automatically | ||
- sets the version based on the tag | ||
- creates a draft release to GitHub | ||
- populates the release notes from `CHANGELOG.md` with `make release-notes` | ||
8. Verify that [release notes](https://github.com/UpCloudLtd/upcloud-go-api/releases) are in line with `CHANGELOG.MD` | ||
9. Publish the drafted release |