Skip to content

Commit c515ceb

Browse files
committed
feat(pipeline): Refactor release process with semantic version validation
1 parent f43b302 commit c515ceb

File tree

2 files changed

+25
-19
lines changed

2 files changed

+25
-19
lines changed

.github/actions/build/action.yml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,7 @@ runs:
2121
shell: bash
2222
run: ./gradlew verifyPlugin check
2323

24-
- name: Release PlugIn
25-
uses: ncipollo/release-action@v1
26-
with:
27-
token: ${{ inputs.github_token }}
28-
artifacts: "build/distributions/html-attribute-folder-*.zip"
29-
name: "html-attribute-folder-${{ inputs.version }}.zip"
30-
tag: "v${{ inputs.version }}"
31-
allowUpdates: true
32-
3324
inputs:
34-
github_token:
35-
description: Access Token for GitHub
36-
required: true
37-
version:
38-
description: Version of the Release
39-
required: true
4025
java_version:
4126
description: Java version to use
4227
required: false

.github/workflows/buildRelease.yml

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ jobs:
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

Comments
 (0)