Skip to content

Commit

Permalink
chore: update pact-cli version on image release (#120)
Browse files Browse the repository at this point in the history
* chore: update pact-cli version on image release
* ci: split commit + push on release
* chore(ci): remove dupe cmd now in new script
  • Loading branch information
YOU54F authored Jan 23, 2024
1 parent 47088ed commit 8f9dc53
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/release_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ on:
inputs:
increment:
description: Increment
default: minor
default: "null"
type: choice
options:
- "null"
- major
- minor
- patch
Expand Down
8 changes: 8 additions & 0 deletions script/release-workflow/git-commit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh

set -euo >/dev/null

if [[ $(git status --porcelain) ]]; then
git add Gemfile.lock VERSION lib/pact/cli/version.rb
git commit -m "chore(release): version ${TAG}"
fi
12 changes: 9 additions & 3 deletions script/release-workflow/next-docker-tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@

set -eu

gem_version_from_gemfile_lock() {
grep "pact_broker (" pact_broker/Gemfile.lock | awk -F '[()]' '{print $2}'
}
# If increment in null, then use the existing version number
# and just increase `n` by 1 in semver version x.y.z.n
# as set in .github./workflows/release_image.yml
# as set in script/release.sh
if [ "${INCREMENT:-}" ]; then
if [ "${INCREMENT:-}" != "null" ]; then
bundle exec bump ${INCREMENT:-minor} --no-commit --replace-in $PWD/lib/pact/cli/version.rb > /dev/null
fi
fi

gem_version=$(ruby -I lib -e "require 'pact/cli/version.rb'; puts Pact::Cli::VERSION")
existing_tags=$(git tag)
Expand Down
1 change: 1 addition & 0 deletions script/release-workflow/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ ${script_dir}/docker-build.sh
${script_dir}/scan.sh
${script_dir}/prepare-release.sh
${script_dir}/docker-push.sh
${script_dir}/git-commit.sh
${script_dir}/git-push.sh

0 comments on commit 8f9dc53

Please sign in to comment.