Skip to content

Commit

Permalink
fix git tag with good version
Browse files Browse the repository at this point in the history
  • Loading branch information
rodolpheche committed Jun 11, 2021
1 parent 5475cd9 commit 1bfe1c6
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,23 @@ jobs:

- name: Update version
run: |
LAST_VERSION=$(git describe --tag --abbrev=0)
LAST_MINOR_VERSION=${LAST_VERSION%.*}
NEW_VERSION=${{ github.event.inputs.version }}
NEW_MINOR_VERSION=${NEW_VERSION%.*}
sed -i s/${LAST_VERSION}/${NEW_VERSION}/g readme.md Dockerfile alpine/Dockerfile
sed -i s/${LAST_MINOR_VERSION}/${NEW_MINOR_VERSION}/g readme.md
git config --local user.name "rodolpheche"
git config --local user.email "[email protected]"
git add .
git commit -m "upgrade to version $LAST_VERSION"
git tag ${LAST_VERSION}
git remote set-url origin https://${{ secrets.GITHUB_TOKEN }}@github.com/rodolpheche/wiremock-docker.git
git push origin main
git push --tags
if [ "${{ matrix.versions.TO_IMAGE }}" = "rodolpheche/wiremock:${{ github.event.inputs.version }}" ]
then
LAST_VERSION=$(git describe --tag --abbrev=0)
LAST_MINOR_VERSION=${LAST_VERSION%.*}
NEW_VERSION=${{ github.event.inputs.version }}
NEW_MINOR_VERSION=${NEW_VERSION%.*}
sed -i s/${LAST_VERSION}/${NEW_VERSION}/g readme.md Dockerfile alpine/Dockerfile
sed -i s/${LAST_MINOR_VERSION}/${NEW_MINOR_VERSION}/g readme.md
git config --local user.name "rodolpheche"
git config --local user.email "[email protected]"
git add .
git commit -m "upgrade to version $NEW_VERSION"
git tag ${NEW_VERSION}
git remote set-url origin https://${{ secrets.GITHUB_TOKEN }}@github.com/rodolpheche/wiremock-docker.git
git push origin main
git push --tags
fi
- name: Release
uses: softprops/action-gh-release@v1
Expand Down

0 comments on commit 1bfe1c6

Please sign in to comment.