-
Notifications
You must be signed in to change notification settings - Fork 2
Adding automatic release process #9
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,28 @@ | ||
| # The gem needs to be configured on rubygems.org to consider this workflow a trusted publisher | ||
| # 1. Go to https://rubygems.org/gems/smart_proxy_dhcp_remote_isc/trusted_publishers | ||
| # 2. Click create | ||
| # 3. Select GitHub Actions as Trusted publisher type | ||
| # 4. Set repository owner and name | ||
| # 5. Set release.yml as Workflow filename | ||
| # 6. Ensure it has an environment set | ||
|
|
||
| name: Release | ||
|
|
||
| on: | ||
| push: | ||
| # Pattern matched against refs/tags | ||
| tags: | ||
| - '**' | ||
|
|
||
| jobs: | ||
| release: | ||
| name: Release gem | ||
| runs-on: ubuntu-latest | ||
| environment: release | ||
| if: github.repository_owner == 'theforeman' | ||
|
|
||
| permissions: | ||
| id-token: write | ||
|
|
||
| steps: | ||
| - uses: voxpupuli/ruby-release@v0 |
This file contains hidden or 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,28 @@ | ||
| # Releasing the plugin | ||
|
|
||
| To release the plugin the following steps are required: | ||
| 1. Checkout the branch you want to make the release from | ||
| 2. Determine what the next version should be | ||
| - We try to follow [semantic versioning (semver)](https://semver.org) | ||
| - Usually we increase the major version only if we bumped the dependency on Foreman | ||
| - For the rest we follow semver | ||
| 3. Bump the version in the version file - `lib/smart_proxy_dhcp_remote_isc/version.rb` | ||
| 4. Make a commit "Bump version to $version" | ||
| 5. Place a version tag on the commit with `git tag v$version` | ||
| - Ideally the tag should be signed. | ||
| 6. Push the commit and the tag to the upstream repository with `git push --follow-tags` | ||
|
|
||
| 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/smart_proxy_dhcp_remote_isc). | ||
|
|
||
| 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: | ||
| ```shell | ||
| gh workflow run bump_packages.yml \ | ||
| --repo theforeman/foreman-packaging \ | ||
| --raw-field package=smart_proxy_dhcp_remote_isc | ||
| ``` | ||
|
|
||
| ### Note on permissions | ||
|
|
||
| The steps outlined above require write access to the repository. 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. | ||
|
|
||
| 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. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ekohl I have removed the link to a team, since no team seem relevant to this plugin. Maybe we should think about adding this plugin to at least some team?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes we should. Not sure who would be in that team though.