Artifactory Staging #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Artifactory Staging | |
on: | |
workflow_dispatch: | |
inputs: | |
releaseVersion: | |
description: "Release version (5.1.x)" | |
required: true | |
jobs: | |
build: | |
name: Stage release to Artifactory | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v3 | |
with: | |
ref: '5.1.x' | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
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 staging repository | |
env: | |
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} | |
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} | |
run: mvn -P artifactory-staging -s settings.xml --batch-mode -Dmaven.test.skip=true deploy |