2121 id : versions
2222 run : echo "TAGGED_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
2323
24+ - name : Validate Version
25+ id : check_version
26+ run : |
27+ if [[ "${{ steps.versions.outputs.TAGGED_VERSION }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
28+ echo "valid=true" >> $GITHUB_OUTPUT
29+ else
30+ echo "valid=false" >> $GITHUB_OUTPUT
31+ fi
32+
2433 - name : Get branch data
2534 uses : tj-actions/branch-names@v7
2635 id : branches
@@ -32,10 +41,22 @@ jobs:
3241 echo "Version: ${{ steps.versions.outputs.TAGGED_VERSION }}"
3342 echo "Branch : ${{ steps.branches.outputs.base_ref_branch || steps.branches.outputs.current_branch }}"
3443
35- - name : Build and Release
44+ - name : Build and Test
3645 uses : ./.github/actions/build
46+
47+ - name : Create GitHub Release
48+ uses : ncipollo/release-action@v1
3749 with :
38- github_token : ${{ secrets.GITHUB_TOKEN }}
39- version : ${{ steps.versions.outputs.TAGGED_VERSION }}
50+ token : ${{ secrets.GITHUB_TOKEN }}
51+ artifacts : " build/distributions/html-attribute-folder-*.zip"
52+ name : " Release v${{ steps.versions.outputs.TAGGED_VERSION }}"
53+ tag : " v${{ steps.versions.outputs.TAGGED_VERSION }}"
54+ prerelease : ${{ steps.check_version.outputs.valid != 'true' }}
55+ allowUpdates : true
4056
41- # TODO Release projekt at IntelliJ's Marketplace
57+ - name : Create IntelliJ's Marketplace Release
58+ # Publish only valid semantic (real) versions
59+ if : steps.check_version.outputs.valid == 'true'
60+ run : ./gradlew publishPlugin
61+ env :
62+ PUBLISH_TOKEN : ${{ secrets.JETBRAINS_MARKETPLACE_TOKEN }}
0 commit comments