gem-released #83
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update gems | |
on: | |
repository_dispatch: | |
types: | |
- gem-released | |
workflow_dispatch: | |
inputs: | |
released_gem_name: | |
description: The name of the gem that was released | |
default: pact_broker | |
required: false | |
released_gem_version: | |
description: The version of the game that was released | |
required: false | |
released_gem_version_increment: | |
description: "The version increment" | |
required: false | |
default: "" | |
type: choice | |
options: | |
- "" | |
- patch | |
- minor | |
- major | |
- pre | |
env: | |
RELEASED_GEM_NAME: '${{ github.event.client_payload.name }}${{ github.event.inputs.released_gem_name }}' | |
RELEASED_GEM_VERSION: '${{ github.event.client_payload.version }}${{ github.event.inputs.released_gem_version }}' | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
working-directory: pact_broker | |
- name: Configure git | |
run: | | |
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
git config --global user.name "${GITHUB_ACTOR}" | |
git config --global push.default current | |
- name: Update gems | |
run: script/update-gems-workflow/update-gems.sh | |
- name: Detect changes | |
run: script/update-gems-workflow/detect-changes.sh | |
- name: Unit tests | |
run: | | |
bundle install | |
bundle exec rake spec | |
- name: Login to Docker Hub | |
run: script/release-workflow/docker-login.sh | |
env: | |
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }} | |
DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }} | |
- name: Build Docker image | |
run: docker build -t pactfoundation/pact-broker:latest . | |
- name: Integration tests | |
run: script/test.sh | |
- name: Git commit and push | |
run: script/update-gems-workflow/git-commit-and-push-gemfile.sh | |
- name: Vulnerability scan | |
run: script/scan.sh pactfoundation/pact-broker:latest | |
- name: Trigger release | |
uses: peter-evans/repository-dispatch@v2 | |
with: | |
token: ${{ secrets.GHTOKENFORPBDOCKERRELEASE }} | |
event-type: release-triggered | |
client-payload: '{"increment": "${{ github.event.client_payload.increment }}${{ github.event.inputs.released_gem_version_increment }}"}' |