From 5c958636e95472023c9ab85e393a6e515c7cf4df Mon Sep 17 00:00:00 2001 From: meysamhadeli Date: Wed, 25 Jan 2023 03:05:26 +0330 Subject: [PATCH] . --- .github/workflows/build-publish-docker.yml | 25 +++++++++++++++------- update-version.sh | 7 ++++++ 2 files changed, 24 insertions(+), 8 deletions(-) create mode 100644 update-version.sh diff --git a/.github/workflows/build-publish-docker.yml b/.github/workflows/build-publish-docker.yml index f418cbb..a5634c9 100644 --- a/.github/workflows/build-publish-docker.yml +++ b/.github/workflows/build-publish-docker.yml @@ -37,6 +37,15 @@ jobs: echo ${{ steps.semantic-version.outputs.semantic_lastRelease_channel }} echo ${{ steps.semantic-version.outputs.semantic_lastRelease_gitTag }} + - name: Update Application Version + run: ./update-version.sh ${{ steps.semantic-version.outputs.semantic_nextRelease_version }} + + - uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: '🔧 chore(release): ${{ steps.semantic-version.outputs.semantic_nextRelease_version }} [skip ci]' + file_pattern: '**/Directory.Packages.props' + disable_globbing: true + - name: Login to DockerHub uses: docker/login-action@v2 with: @@ -45,15 +54,15 @@ jobs: - name: Build image run: | - docker build -t meysamh66/booking-microservices-flight:latest -f "${{ github.workspace }}/src/Services/Flight/Dockerfile" . - docker build -t meysamh66/booking-microservices-identity:latest -f "${{ github.workspace }}/src/Services/Identity/Dockerfile" . - docker build -t meysamh66/booking-microservices-passenger:latest -f "${{ github.workspace }}/src/Services/Passenger/Dockerfile" . - docker build -t meysamh66/booking-microservices-booking:latest -f "${{ github.workspace }}/src/Services/Booking/Dockerfile" . + docker build -t meysamh66/booking-microservices-flight:${{ steps.semantic-version.outputs.semantic_nextRelease_version }} -f "${{ github.workspace }}/src/Services/Flight/Dockerfile" . + docker build -t meysamh66/booking-microservices-identity:${{ steps.semantic-version.outputs.semantic_nextRelease_version }} -f "${{ github.workspace }}/src/Services/Identity/Dockerfile" . + docker build -t meysamh66/booking-microservices-passenger:${{ steps.semantic-version.outputs.semantic_nextRelease_version }} -f "${{ github.workspace }}/src/Services/Passenger/Dockerfile" . + docker build -t meysamh66/booking-microservices-booking:${{ steps.semantic-version.outputs.semantic_nextRelease_version }} -f "${{ github.workspace }}/src/Services/Booking/Dockerfile" . - name: Publish image run: | - docker push meysamh66/booking-microservices-flight:latest - docker push meysamh66/booking-microservices-identity:latest - docker push meysamh66/booking-microservices-passenger:latest - docker push meysamh66/booking-microservices-booking:latest + docker push meysamh66/booking-microservices-flight:${{ steps.semantic-version.outputs.semantic_nextRelease_version }} + docker push meysamh66/booking-microservices-identity:${{ steps.semantic-version.outputs.semantic_nextRelease_version }} + docker push meysamh66/booking-microservices-passenger:${{ steps.semantic-version.outputs.semantic_nextRelease_version }} + docker push meysamh66/booking-microservices-booking:${{ steps.semantic-version.outputs.semantic_nextRelease_version }} diff --git a/update-version.sh b/update-version.sh new file mode 100644 index 0000000..28c6f73 --- /dev/null +++ b/update-version.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +# update package version and version for in the csproj file to new version and commit it again with using https://github.com/semantic-release/git plugin +# https://unix.stackexchange.com/questions/50313/how-do-i-perform-an-action-on-all-files-with-a-specific-extension-in-subfolders +find . -name '*.Packages.props' -exec sed -i "s#.*#$1#" {} \; -exec cat {} \; +find . -name '*.Packages.props' -exec sed -i "s#.*#$1#" {} \; -exec cat {} \; +find . -name '*.Packages.props' -exec sed -i "s#.*#$1#" {} \; -exec cat {} \;