Skip to content

Commit 33c06e1

Browse files
authored
Fixes #38982 - Add automatic release process (#15)
1 parent 3fa10e8 commit 33c06e1

3 files changed

Lines changed: 53 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
# Pattern matched against refs/tags
6+
tags:
7+
- '**'
8+
9+
jobs:
10+
release:
11+
name: Release gem
12+
runs-on: ubuntu-latest
13+
environment: release
14+
if: github.repository_owner == 'theforeman'
15+
16+
permissions:
17+
id-token: write
18+
19+
steps:
20+
- uses: voxpupuli/ruby-release@v0

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This Hammer CLI plugin contains set of commands for [foreman_webhooks](
88

99
This is the list of which version of Foreman Webhooks is needed to which version of this plugin.
1010

11-
| hammer_cli_foreman_webhooks | v0.0.1 | v0.0.3 |
11+
| hammer_cli_foreman_webhooks | v0.0.1 | v0.0.3 |
1212
|-----------------------------|--------|--------|
1313
| foreman_webhooks | v0.0.1 | v3.0.2 |
1414

@@ -30,3 +30,7 @@ This is the list of which version of Foreman Webhooks is needed to which version
3030

3131
See our [Hammer CLI installation and configuration instuctions](
3232
https://github.com/theforeman/hammer-cli/blob/master/doc/installation.md#installation).
33+
34+
## Release
35+
36+
Please refer to [RELEASE.md](RELEASE.md)

RELEASE.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Releasing the plugin
2+
3+
To release the plugin the following steps are required:
4+
1. Checkout the branch you want to make the release from
5+
2. Determine what the next version should be
6+
- We try to follow [semantic versioning (semver)](https://semver.org)
7+
- Usually we don't increase the major version for hammer plugins, only minor if it requires a newer corresponding Foreman plugin. Most of the time you bump patch version.
8+
- For the rest we follow semver
9+
3. Bump the version in the version file - `lib/hammer_cli_foreman_webhooks/version.rb`
10+
4. Make a commit "Bump version to $version"
11+
5. Place a version tag on the commit with `git tag v$version`
12+
- Ideally the tag should be signed.
13+
6. Push the commit and the tag to the upstream repository with `git push --follow-tags`
14+
15+
When the tag is pushed to git, [the release workflow](.github/workflows/release.yml) should get triggered and should build the gem and push it to [rubygems.org](https://rubygems.org/gems/hammer_cli_foreman_webhooks).
16+
17+
Once the new version lands in rubygems, consider filing a packaging PR on [foreman-packaging](https://github.com/theforeman/foreman-packaging) or triggering it via automation with:
18+
```shell
19+
gh workflow run bump_packages.yml \
20+
--repo theforeman/foreman-packaging \
21+
--raw-field package=hammer_cli_foreman_webhooks
22+
```
23+
24+
### Note on permissions
25+
26+
The steps outlined above require write access to the repository. This is generally controlled by membership in the [@webhooks](https://github.com/orgs/theforeman/teams/webhooks) team. If needed, steps 1-4 can be done even without permissions. In that case, skip step 5, push the changes to your own fork and send us a pull request, asking for a maintainer to perform step 5.
27+
28+
Similar situation applies to the packaging workflow. It can be triggered (and resulting PRs merged) by members of the team. PRs can also be prepared by hand and sent by anyone.

0 commit comments

Comments
 (0)