From 46d83419ff32a9841527f90b1dfb389b363530c5 Mon Sep 17 00:00:00 2001 From: dej Date: Wed, 2 Aug 2023 11:31:02 +0200 Subject: [PATCH] ci: rework release creation --- .github/workflows/create-release.yml | 22 ++++++++------ .github/workflows/create-tag.yml | 43 ---------------------------- 2 files changed, 14 insertions(+), 51 deletions(-) delete mode 100644 .github/workflows/create-tag.yml diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 5d88507..cd0ed20 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -1,9 +1,7 @@ -name: Keycloak Verify email by code Tag +name: create tag/release on: - push: - tags: - - "*" + workflow_dispatch: jobs: build: @@ -27,15 +25,23 @@ jobs: with: java-version: 17 - - id: get_version - run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3) + - name: Set Release version + run: | + mvn versions:set -DremoveSnapshot -DgenerateBackupPoms=false - - name: Set current version - run: mvn -B versions:set -DnewVersion=${{ steps.get_version.outputs.VERSION }} + - name: Get pom version + id: get_version + run: | + echo ::set-output name=VERSION::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) - name: Build with Maven run: mvn -B clean verify + - uses: rickstaa/action-create-tag@v1 + id: "tag_create" + with: + tag: ${{ steps.get_version.outputs.VERSION }} + - name: Upload jar uses: actions/upload-artifact@v2 with: diff --git a/.github/workflows/create-tag.yml b/.github/workflows/create-tag.yml deleted file mode 100644 index f3d434b..0000000 --- a/.github/workflows/create-tag.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: CreateTag - -on: - workflow_dispatch: - -jobs: - build: - name: Build - runs-on: ubuntu-latest - outputs: - version: ${{ steps.get_version.outputs.VERSION }} - steps: - - uses: actions/checkout@v2 - - - name: Cache local Maven repository - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - - name: Set up JDK 17 - uses: actions/setup-java@v1 - with: - java-version: 17 - - - name: Build with Maven - run: mvn -B clean verify - - - name: Set Release version - run: | - mvn versions:set -DremoveSnapshot -DgenerateBackupPoms=false - - - name: Get pom version - id: get_version - run: | - echo ::set-output name=VERSION::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) - - - uses: rickstaa/action-create-tag@v1 - id: "tag_create" - with: - tag: ${{ steps.get_version.outputs.VERSION }}