Skip to content

Commit

Permalink
fix: Prepare for 1.2 release (#34)
Browse files Browse the repository at this point in the history
fix: Prepare for 1.2 release (#34)
  • Loading branch information
fmarek-kindred authored May 27, 2024
1 parent c860adf commit 7eb2530
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 7 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/ghcr_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name: ghcr.io Publish
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]'
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-[a-zA-Z]+'
- 'v[0-9]+.[0-9]+.[0-9]+(-[a-zA-Z]+)+.[0-9]?'

Expand All @@ -33,7 +33,11 @@ jobs:
echo $RELEASE_VERSION
echo ${{ env.RELEASE_VERSION }}
- name: Build and publish "Lock Manager" image
run: bash bin/ghcr-publish.sh lock-manager $RELEASE_VERSION "y"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bash bin/ghcr-publish.sh lock-manager $RELEASE_VERSION "y" $GITHUB_TOKEN

- name: Build and publish "Brownie" image
run: bash bin/ghcr-publish.sh brownie $RELEASE_VERSION "y"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bash bin/ghcr-publish.sh brownie $RELEASE_VERSION "y" $GITHUB_TOKEN
26 changes: 22 additions & 4 deletions bin/ghcr-publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ set -e
application=$1
version=$2
makeAdditionalTag=$3
gitHubToken=$4

if [ "${makeAdditionalTag}" == "" ];
then
Expand All @@ -26,6 +27,7 @@ push_tag() {
echo "all args = $@"
application=$1
version=$2
isSlidingTag=$3

tagWithVersion=$application:$version
echo "tagWithVersion=${tagWithVersion}"
Expand All @@ -41,6 +43,7 @@ push_tag() {

echo "docker build --tag $tagRef ."
docker build --tag "${tagRef}" .

echo "docker push ${tagRef}"
docker push "${tagRef}"
echo ""
Expand All @@ -49,10 +52,9 @@ push_tag() {
home=$(pwd)
echo "cd $application"
cd $application
push_tag "${application}" "${version}"

if [ "${makeAdditionalTag}" == "n" ];
then
push_tag "${application}" "${version}"
exit 0
fi

Expand Down Expand Up @@ -92,9 +94,25 @@ fi
majorMinorVersion="${array[0]}.${array[1]}"
echo "Computed majorMinorVersion=${majorMinorVersion}"

push_tag "${application}" "${majorMinorVersion}"

cd $home

tagWithVersion=$application:$version
echo "tagWithVersion=${tagWithVersion}"
tagRef=ghcr.io/kindredgroup/pit-toolkit/$tagWithVersion
echo "tagRef=${tagRef}"
echo ""

echo "docker build --tag $tagRef ."
docker build --tag "${tagRef}" .
shortTagRef=ghcr.io/kindredgroup/pit-toolkit/$application:$majorMinorVersion
docker tag "${tagRef}" "${shortTagRef}"
docker images

echo "push -a ghcr.io/kindredgroup/pit-toolkit/$application"
echo "-- before pushing docker iamge --"
docker push -q -a "ghcr.io/kindredgroup/pit-toolkit/$application"
echo "-- after pushing docker iamge --"
cd $home
git tag -f "${majorMinorVersion}"
git push origin tag "${majorMinorVersion}"
echo ""

0 comments on commit 7eb2530

Please sign in to comment.