Skip to content

Commit ba8d0d4

Browse files
committed
Fixes #38980 - Add automatic release process
1 parent 44b5c9b commit ba8d0d4

3 files changed

Lines changed: 50 additions & 0 deletions

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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,6 @@ Extension module hammer_cli_foreman_openscap (version) loaded
7171
If you see no errors, you should be good to go.
7272

7373

74+
## Release
7475

76+
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 increase the major version only if we bumped the dependency on Foreman
8+
- For the rest we follow semver
9+
3. Bump the version in the version file - `lib/hammer_cli_foreman_openscap/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_openscap).
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_openscap
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 [@openscap](https://github.com/orgs/theforeman/teams/openscap) 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)