This commit is contained in:
meysamhadeli 2023-01-25 03:05:26 +03:30
parent 58768875ab
commit 5c958636e9
2 changed files with 24 additions and 8 deletions

View File

@ -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 }}

7
update-version.sh Normal file
View File

@ -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#<PackageVersion>.*#<PackageVersion>$1</PackageVersion>#" {} \; -exec cat {} \;
find . -name '*.Packages.props' -exec sed -i "s#<InformationalVersion>.*#<InformationalVersion>$1</InformationalVersion>#" {} \; -exec cat {} \;
find . -name '*.Packages.props' -exec sed -i "s#<Version>.*#<Version>$1</Version>#" {} \; -exec cat {} \;