1
0
Fork 0
mirror of https://github.com/ansible-collections/hetzner.hcloud.git synced 2026-02-04 08:01:49 +00:00

ci: setup release-please (#317)

##### SUMMARY

The current release process for this project requires multiple manual
local steps to prepare and then tag the release. This introduces the
standard release-please workflow we have in most of our integrations.

Release-please will open a new PR whenever there is a releasable change
and it updates the CHANGELOG & other files automatically in this PR.
Once the PR is merged a new tag is created.

This repository has some additional complexity as it uses
`antsibull-changelog` to maintain the user-facing changelog. This is
implemented ina second job in the `release-please` workflow which
executes when the release-please PR is updated and then runs
`antsibull-changelog release` against the version. The resulting changes
are pushed as a second commit to the same PR.
This commit is contained in:
Julian Tölle 2023-09-05 14:49:05 +02:00 committed by GitHub
parent 0f057b185f
commit eb4114bad3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 88 additions and 45 deletions

View file

@ -61,31 +61,4 @@ ansible-test integration --color --local -vvv hcloud_server // Executed all int
## Releasing a new version
1. Make sure your local `main` branch is in a clean state and is up to date.
2. Define a new version:
```sh
export HCLOUD_VERSION=1.15.0
```
3. Create a release branch:
```sh
git checkout -b "release-$HCLOUD_VERSION"
```
4. Generate the changelog for the new version, it should remove all fragments and change
the `changelogs/changelog.yaml` and `CHANGELOG.rst`:
```sh
antsibull-changelog release --version "$HCLOUD_VERSION"
git add changelogs/changelog.yaml changelogs/fragments CHANGELOG.rst
```
5. Update the `version` in the ansible galaxy metadata file:
```sh
sed -i "s/^version: .*/version: $HCLOUD_VERSION/" galaxy.yml
scripts/version-sync.sh
git add galaxy.yml plugins/module_utils/version.py
```
6. Commit the changes:
```sh
git commit -m "chore: prepare v$HCLOUD_VERSION"
```
7. Push the changes to Github, open a Pull Request and follow the process to get the PR merged into `main`.
8. Once the PR is merged, tag the release through the Github UI, after this the Github Actions will run and publish the collection to Ansible
Galaxy.
If there are releasable changes, `release-please` will open a PR on GitHub with the proposed version. When this PR is merged, `release-please` will tag the release.