diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..9a79676 --- /dev/null +++ b/.github/workflows/release.yml @@ -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 diff --git a/.gitignore b/.gitignore index fc29803..c03bbba 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ test-app/pids test-app/procodile.log global.yml *.gem +Gemfile.lock diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..76f5c64 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "1.0.27" +} diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index dcf60de..0000000 --- a/Gemfile.lock +++ /dev/null @@ -1,37 +0,0 @@ -PATH - remote: . - specs: - procodile (1.0.27) - json - -GEM - remote: https://rubygems.org/ - specs: - diff-lcs (1.3) - json (2.2.0) - rspec (3.5.0) - rspec-core (~> 3.5.0) - rspec-expectations (~> 3.5.0) - rspec-mocks (~> 3.5.0) - rspec-core (3.5.4) - rspec-support (~> 3.5.0) - rspec-expectations (3.5.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.5.0) - rspec-mocks (3.5.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.5.0) - rspec-support (3.5.0) - -PLATFORMS - ruby - -DEPENDENCIES - procodile! - rspec - rspec-core - rspec-expectations - rspec-mocks - -BUNDLED WITH - 1.17.3 diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..17f1958 --- /dev/null +++ b/release-please-config.json @@ -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" +}