From 83511111c1bedba42306630a67a20de7e26d9d96 Mon Sep 17 00:00:00 2001 From: Mahmoud Ben Hassine Date: Fri, 27 Oct 2023 14:33:58 +0200 Subject: [PATCH] Add milestone release workflow --- .../artifactory-milestone-release.yml | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/artifactory-milestone-release.yml diff --git a/.github/workflows/artifactory-milestone-release.yml b/.github/workflows/artifactory-milestone-release.yml new file mode 100644 index 0000000..0b6d1e3 --- /dev/null +++ b/.github/workflows/artifactory-milestone-release.yml @@ -0,0 +1,38 @@ +name: Artifactory Milestone Release + +on: + workflow_dispatch: + inputs: + releaseVersion: + description: "Milestone release version" + required: true + +jobs: + build: + name: Release milestone to Artifactory + runs-on: ubuntu-latest + steps: + - name: Checkout source code + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - name: Set up JDK 17 + uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 #v3.13.0 + with: + java-version: '17' + distribution: 'temurin' + cache: 'maven' + + - name: Capture release version + run: echo RELEASE_VERSION=${{ github.event.inputs.releaseVersion }} >> $GITHUB_ENV + + - name: Update release version + run: mvn versions:set -DgenerateBackupPoms=false -DnewVersion=$RELEASE_VERSION + + - name: Enforce release rules + run: mvn org.apache.maven.plugins:maven-enforcer-plugin:enforce -Drules=requireReleaseDeps + + - name: Build with Maven and deploy to Artifactory's milestone repository + env: + ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} + ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} + run: mvn -P artifactory-milestone -s settings.xml --batch-mode -Dmaven.test.skip=true deploy