forked from adamcooke/procodile
-
Notifications
You must be signed in to change notification settings - Fork 0
ci: automate releases with release-please and publish to RubyGems #6
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
Open
facundofarias
wants to merge
1
commit into
rename-gem-for-publishing
Choose a base branch
from
release-automation
base: rename-gem-for-publishing
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
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,52 @@ | ||
| name: Release | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
|
|
||
| jobs: | ||
| # Maintains a release PR that bumps lib/procodile/version.rb and the CHANGELOG | ||
| # from Conventional Commit messages. Merging that PR is what cuts a release. | ||
| release-please: | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| release_created: ${{ steps.release-please.outputs.release_created }} | ||
| version: ${{ steps.release-please.outputs.version }} | ||
| steps: | ||
| - uses: googleapis/release-please-action@v4 | ||
| id: release-please | ||
|
|
||
| release: | ||
| runs-on: ubuntu-latest | ||
| needs: [release-please] | ||
| if: ${{ needs.release-please.outputs.release_created }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: ruby/setup-ruby@v1 | ||
| with: | ||
| ruby-version: '3.4' | ||
| bundler-cache: true | ||
|
|
||
| # The release workflow runs on master, after the release PR is merged, so | ||
| # nothing has re-run the suite against the merge result. Publishing is | ||
| # irreversible -- a pushed version number can be yanked but never reused -- | ||
| # so gate the push on a green suite rather than assuming. | ||
| - name: Run tests | ||
| run: bundle exec rspec -Ilib | ||
|
|
||
| - name: Build gem | ||
| run: gem build *.gemspec | ||
|
|
||
| - name: Setup credentials | ||
| run: | | ||
| mkdir -p $HOME/.gem | ||
| touch $HOME/.gem/credentials | ||
| chmod 0600 $HOME/.gem/credentials | ||
| printf -- "---\n:rubygems_api_key: ${RUBYGEMS_API_KEY}\n" > $HOME/.gem/credentials | ||
| env: | ||
| RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }} | ||
|
|
||
| - name: Publish to RubyGems | ||
| run: gem push *.gem | ||
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 |
|---|---|---|
|
|
@@ -4,3 +4,4 @@ test-app/pids | |
| test-app/procodile.log | ||
| global.yml | ||
| *.gem | ||
| Gemfile.lock | ||
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,3 @@ | ||
| { | ||
| ".": "1.0.27" | ||
| } |
This file was deleted.
Oops, something went wrong.
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,27 @@ | ||
| { | ||
| "pull-request-header": ":robot: I have created a release", | ||
| "packages": { | ||
| ".": { | ||
| "release-type": "ruby", | ||
| "version-file": "lib/procodile/version.rb", | ||
| "changelog-path": "CHANGELOG.md", | ||
| "draft": false, | ||
| "prerelease": false | ||
| } | ||
| }, | ||
| "changelog-sections": [ | ||
| { "type": "feat", "section": "Features" }, | ||
| { "type": "feature", "section": "Features" }, | ||
| { "type": "fix", "section": "Bug Fixes" }, | ||
| { "type": "perf", "section": "Performance Improvements" }, | ||
| { "type": "revert", "section": "Reverts" }, | ||
| { "type": "docs", "section": "Documentation" }, | ||
| { "type": "style", "section": "Styles" }, | ||
| { "type": "chore", "section": "Miscellaneous Chores" }, | ||
| { "type": "refactor", "section": "Code Refactoring" }, | ||
| { "type": "test", "section": "Tests", "hidden": true }, | ||
| { "type": "build", "section": "Build System", "hidden": true }, | ||
| { "type": "ci", "section": "Continuous Integration", "hidden": true } | ||
| ], | ||
| "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json" | ||
| } |
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.
When the repository or organization uses the read-only default for
GITHUB_TOKEN, this action cannot create or update its release PR, tag, or GitHub release, so the new publishing flow never reaches thereleasejob. Explicitly grantcontents: writeandpull-requests: writeat the workflow orrelease-pleasejob level rather than relying on an external repository setting.Useful? React with 👍 / 👎.