Compare commits
3 Commits
596baba5ef
...
v0.1.5
Author | SHA1 | Date | |
---|---|---|---|
ab11665665 | |||
37468b6785 | |||
471767c4ed |
@@ -50,6 +50,8 @@ jobs:
|
|||||||
tag_name: ${{ steps.set_tag.outputs.tag_name }}
|
tag_name: ${{ steps.set_tag.outputs.tag_name }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Determine next semantic version tag
|
- name: Determine next semantic version tag
|
||||||
id: set_tag
|
id: set_tag
|
||||||
@@ -79,6 +81,7 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
new_tag="v${major}.${minor}.${patch}"
|
new_tag="v${major}.${minor}.${patch}"
|
||||||
|
echo "Creating new version tag: ${new_tag}"
|
||||||
echo "tag_name=${new_tag}" >> $GITHUB_OUTPUT
|
echo "tag_name=${new_tag}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
docker-build-and-push:
|
docker-build-and-push:
|
||||||
@@ -115,12 +118,29 @@ jobs:
|
|||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Set up Git user
|
- name: Check if tag already exists
|
||||||
|
id: check_tag
|
||||||
run: |
|
run: |
|
||||||
git config user.name "GitHub Actions"
|
git fetch --tags
|
||||||
git config user.email "actions@github.com"
|
if git rev-parse "${{ needs.set-tag.outputs.tag_name }}" >/dev/null 2>&1; then
|
||||||
|
echo "Tag ${{ needs.set-tag.outputs.tag_name }} already exists!"
|
||||||
|
echo "exists=true" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "Tag ${{ needs.set-tag.outputs.tag_name }} does not exist"
|
||||||
|
echo "exists=false" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Create and push tag
|
- name: Create and push tag
|
||||||
|
if: steps.check_tag.outputs.exists == 'false'
|
||||||
run: |
|
run: |
|
||||||
|
echo "Creating new tag: ${{ needs.set-tag.outputs.tag_name }}"
|
||||||
|
git config user.name "GitHub Actions"
|
||||||
|
git config user.email "actions@github.com"
|
||||||
git tag ${{ needs.set-tag.outputs.tag_name }}
|
git tag ${{ needs.set-tag.outputs.tag_name }}
|
||||||
git push origin ${{ needs.set-tag.outputs.tag_name }}
|
git push origin ${{ needs.set-tag.outputs.tag_name }}
|
||||||
|
echo "Tag created and pushed successfully"
|
||||||
|
|
||||||
|
- name: Skip tag creation
|
||||||
|
if: steps.check_tag.outputs.exists == 'true'
|
||||||
|
run: |
|
||||||
|
echo "Skipping tag creation - ${{ needs.set-tag.outputs.tag_name }} already exists"
|
Reference in New Issue
Block a user