Skip to content

Commit

Permalink
ci: record release in pactflow when gem is released
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed Sep 11, 2023
1 parent 398d58c commit e055a55
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 11 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/release_gem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
- run: |
gem install bundler -v 2.4
bundle install
Expand All @@ -38,6 +36,23 @@ jobs:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
INCREMENT: '${{ github.event.client_payload.increment }}'

record-release:
needs: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
- name: Bundle install
run: |
gem install bundler -v 2.4
bundle config set --local without development test
bundle install
- name: Record release
run: script/ci/record-release.sh
env:
PACT_BROKER_BASE_URL: https://pact-foundation.pactflow.io
PACT_BROKER_TOKEN: ${{ secrets.PACT_BROKER_TOKEN_PACT_FOUNDATION }}

notify-gem-released:
needs: release
strategy:
Expand Down
9 changes: 8 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,12 @@ if ENV['X_PACT_DEVELOPMENT'] == 'true'
end

group :development do
gem 'fakefs', '~> 2.4'
gem 'webmock', '~> 3.0'
gem 'conventional-changelog', '~>1.3'
gem 'pact', '~> 1.16'
gem 'pact-support', '~> 1.16'
gem 'approvals', '0.0.26'
gem 'rspec-its', '~> 1.3'
gem 'pry-byebug'
end
end
8 changes: 0 additions & 8 deletions pact-broker-client.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,4 @@ Gem::Specification.new do |gem|
gem.add_runtime_dependency 'thor', '>= 0.20', '< 2.0'
gem.add_runtime_dependency 'rake', '~> 13.0' #For FileList
gem.add_runtime_dependency 'dig_rb', '~> 1.0'

gem.add_development_dependency 'fakefs', '~> 2.4'
gem.add_development_dependency 'webmock', '~> 3.0'
gem.add_development_dependency 'conventional-changelog', '~>1.3'
gem.add_development_dependency 'pact', '~> 1.16'
gem.add_development_dependency 'pact-support', '~> 1.16'
gem.add_development_dependency 'approvals', '0.0.26'
gem.add_development_dependency 'rspec-its', '~> 1.3'
end
7 changes: 7 additions & 0 deletions script/ci/record-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

set -Eeuxo pipefail

bundle exec bin/pact-broker record-deployment \
--pacticipant "Pact Broker Client" --version $GITHUB_SHA \
--environment production

0 comments on commit e055a55

Please sign in to comment.