From 7c2bc0f07519351f7f26b2348a8c354acf019c41 Mon Sep 17 00:00:00 2001 From: JonasG Date: Tue, 16 Jan 2024 11:52:26 +0100 Subject: [PATCH] build: add tagging requirement when releasing build: add tagging requirement when releasing --- .github/workflows/release.yml | 19 +++++++++++++------ .github/workflows/tag.yml | 31 ------------------------------- 2 files changed, 13 insertions(+), 37 deletions(-) delete mode 100644 .github/workflows/tag.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fdb9e6e..b500d8a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,21 +1,28 @@ name: Release and Publish package to the Maven Central Repository + on: - push: - tags: - - v* - pull_request: - branches: [ main ] + workflow_dispatch: + inputs: + name: + type: string + description: tag + jobs: publish: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - name: Tag Release + uses: tvdias/github-tagger@v0.0.1 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" + tag: "${{ github.event.inputs.message }}" - name: Set up Java uses: actions/setup-java@v3 with: java-version: '17' distribution: 'adopt' - - name: Publish package + - name: Release env: JRELEASER_NEXUS2_USERNAME: ${{ secrets.JRELEASER_NEXUS2_USERNAME }} JRELEASER_NEXUS2_PASSWORD: ${{ secrets.JRELEASER_NEXUS2_PASSWORD }} diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml deleted file mode 100644 index a9a21a7..0000000 --- a/.github/workflows/tag.yml +++ /dev/null @@ -1,31 +0,0 @@ -# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven - -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -name: Java CI with Maven - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - name: Set up JDK 17 - uses: actions/setup-java@v3 - with: - java-version: '17' - distribution: 'temurin' - cache: maven - - name: Build with Maven - run: mvn -B verify --file pom.xml