Skip to content

Commit

Permalink
Merge remote-tracking branch 'you54f/chore/release_docker_tags'
Browse files Browse the repository at this point in the history
  • Loading branch information
YOU54F committed Jan 23, 2024
2 parents 47088ed + 80856da commit ccc7412
Show file tree
Hide file tree
Showing 5 changed files with 24 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
4 changes: 4 additions & 0 deletions script/release-workflow/git-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

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
git tag -a "${TAG}" -m "chore(release): version ${TAG}"
git push origin ${TAG}
git push origin master
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 ccc7412

Please sign in to comment.