Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/release.yml
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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Grant release-please write permissions

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 the release job. Explicitly grant contents: write and pull-requests: write at the workflow or release-please job level rather than relying on an external repository setting.

Useful? React with 👍 / 👎.

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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ test-app/pids
test-app/procodile.log
global.yml
*.gem
Gemfile.lock
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "1.0.27"
}
37 changes: 0 additions & 37 deletions Gemfile.lock

This file was deleted.

27 changes: 27 additions & 0 deletions release-please-config.json
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"
}