Skip to content

Commit

Permalink
Setup steps after release-please to automate gem version syncing
Browse files Browse the repository at this point in the history
This is an attempt to automatically sync our gem versions after
release-please detects the need to bump the version. It will open up a
PR with that new version bump to judoscale-ruby and changelog added, and
these extra steps should follow-up that with syncing the new version
across the other libraries.

I have done some manual testing on this using a separate branch, by
commenting out the release-please and "if" statements, and only
triggering these actual steps that sync versions and push a new commit.
By bumping the judoscale-ruby version myself in a commit, the automated
steps here would generate a new follow-up commit automatically syncing
the other gems versions, so I'm hopeful this will work as expected.
(famous last words)

The git user name/email and commands in general are based on examples:
https://github.com/actions/checkout?tab=readme-ov-file#push-a-commit-using-the-built-in-token
https://github.com/google-github-actions/release-please-action/tree/v3.7.13?tab=readme-ov-file#creating-majorminor-tags
  • Loading branch information
carlosantoniodasilva committed May 3, 2024
1 parent a525e92 commit daeb3be
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,26 @@ jobs:
bump-minor-pre-major: true
version-file: "judoscale-ruby/lib/judoscale/version.rb"

- name: Sync versions - checkout code
if: ${{ steps.release.outputs.release_created }}
uses: actions/checkout@v4

- name: Sync versions - setup Ruby
if: ${{ steps.release.outputs.release_created }}
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3

- name: Sync versions
if: ${{ steps.release.outputs.release_created }}
run: |
bin/sync-versions
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git add .
git commit -m "Sync versions"
git push
publish:
name: Publish to Rubygems
needs: release-please
Expand All @@ -29,12 +49,12 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2.2
ruby-version: 3.3

- name: Publish gems
env:
Expand Down

0 comments on commit daeb3be

Please sign in to comment.