Skip to content

Commit

Permalink
CI: fix publish gem condition (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
ami-descope committed Mar 19, 2024
1 parent e21ec2f commit dcae879
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
17 changes: 1 addition & 16 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,4 @@ jobs:
env:
DESCOPE_MANAGEMENT_KEY: ${{ secrets.DESCOPE_MANAGEMENT_KEY }}
DESCOPE_PROJECT_ID: ${{ secrets.DESCOPE_PROJECT_ID }}
run: bundle exec rspec spec/integration

# in order to release use conventional commits
# $ git commit --allow-empty -m "chore: release 1.0.0" -m "Release-As: 1.0.0" && git push
# this will open a new PR with the changelog and bump the version
# Release Please will assume that you are using Conventional Commit messages.
#
# The most important prefixes you should have in mind are:
#
# fix: which represents bug fixes, and correlates to a SemVer patch.
# feat: which represents a new feature, and correlates to a SemVer minor.
# feat!:, or fix!:, refactor!:, etc., which represent a breaking change (indicated by the !) and will result in a SemVer major.
- uses: google-github-actions/release-please-action@v4
id: release
if: github.ref == 'refs/heads/main'

run: bundle exec rspec spec/integration
16 changes: 14 additions & 2 deletions .github/workflows/publish-gem.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Publish Ruby Gem

on:
release:
types: [created]
types: [published]

permissions:
contents: read
Expand All @@ -23,6 +23,19 @@ jobs:

- name: Install dependencies
run: bundle install
# in order to release use conventional commits
# $ git commit --allow-empty -m "chore: release 1.0.0" -m "Release-As: 1.0.0" && git push
# this will open a new PR with the changelog and bump the version
# Release Please will assume that you are using Conventional Commit messages.
#
# The most important prefixes you should have in mind are:
#
# fix: which represents bug fixes, and correlates to a SemVer patch.
# feat: which represents a new feature, and correlates to a SemVer minor.
# feat!:, or fix!:, refactor!:, etc., which represent a breaking change (indicated by the !) and will result in a SemVer major.
- uses: google-github-actions/release-please-action@v4
id: release
if: github.ref == 'refs/heads/main'

- name: Publish to RubyGems
run: |
Expand All @@ -34,4 +47,3 @@ jobs:
gem push *.gem
env:
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_API_KEY}}"
if: ${{ steps.release.outputs.release_created }}

0 comments on commit dcae879

Please sign in to comment.