diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7f8970e..77861d4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,7 +1,8 @@ name: Release on: push: - branches: [ "main" ] + tags: + - v* workflow_dispatch: inputs: version: @@ -27,7 +28,9 @@ jobs: java-version: '11' distribution: 'adopt' - name: Set Version - run: mvn versions:set -DnewVersion=${{ github.event.inputs.version }} -B + run: | + version=$(echo ${{ github.event.inputs.version }} | sed 's/^v//') + mvn versions:set -DnewVersion=$version -B - name: Build with Maven run: mvn -B package --file pom.xml - name: Publish to GitHub Packages Apache Maven @@ -39,7 +42,7 @@ jobs: # env: # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # with: -# tag_name: ${{ github.event.inputs.version }} -# release_name: apm-proto ${{ github.event.inputs.version }} +# tag_name: ${{ github.ref_name }} +# release_name: apm-proto ${{ github.ref_name }} # draft: false # prerelease: false