Skip to content

Commit

Permalink
Update create-release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
kerphi authored Mar 18, 2022
1 parent bea1f22 commit 15da9e5
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,29 @@ jobs:
runs-on: ubuntu-latest

steps:

- name: 'Checkout source code'
uses: 'actions/checkout@v3'
with:
fetch-depth: '0' # to get all the tags locally
# https://stackoverflow.com/questions/67550727/push-event-doesnt-trigger-workflow-on-push-paths-github-actions
token: ${{ secrets.TOKEN_GITHUB_FOR_GITHUB_ACTION }}



- name: 'Verify version is semver formatted (X.X.X)'
env:
NEW_TAG: ${{ github.event.inputs.releaseVersion }}
run: |
echo $NEW_TAG | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$'
- name: 'Verify version is not already used as a git tag'
env:
NEW_TAG: ${{ github.event.inputs.releaseVersion }}
run: |
[[ "$(git tag --list | grep $NEW_TAG)" == "" ]] && exit 0 || exit 1
- name: 'Generates the new version (patch few files + git tag)'
env:
NEW_TAG: ${{ github.event.inputs.releaseVersion }}
Expand All @@ -41,3 +47,11 @@ jobs:
git commit README.md docker-compose.yml -m "Version $NEW_TAG"
git tag $NEW_TAG
git push && git push --tags
- name: 'Create the github release'
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.event.inputs.releaseVersion }}
generate_release_notes: true

0 comments on commit 15da9e5

Please sign in to comment.