Add github action to stage a release to Artifactory
This commit is contained in:
38
.github/workflows/artifactory-stage.yml
vendored
Normal file
38
.github/workflows/artifactory-stage.yml
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
name: Artifactory Staging
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
releaseVersion:
|
||||
description: "Release version"
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Stage release to Artifactory
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout source code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- 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: Enforce release rules
|
||||
run: mvn org.apache.maven.plugins:maven-enforcer-plugin:enforce -Drules=requireReleaseDeps
|
||||
|
||||
- name: Update release version
|
||||
run: mvn versions:set -DgenerateBackupPoms=false -DnewVersion=$RELEASE_VERSION
|
||||
|
||||
- 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 -s settings.xml --batch-mode -Dmaven.test.skip=true deploy
|
||||
12
pom.xml
12
pom.xml
@@ -344,6 +344,18 @@
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>artifactory</id>
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>spring-staging</id>
|
||||
<url>https://repo.spring.io/libs-staging-local</url>
|
||||
<snapshots>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<repositories>
|
||||
|
||||
@@ -9,6 +9,11 @@
|
||||
<username>${env.ARTIFACTORY_USERNAME}</username>
|
||||
<password>${env.ARTIFACTORY_PASSWORD}</password>
|
||||
</server>
|
||||
<server>
|
||||
<id>spring-staging</id>
|
||||
<username>${env.ARTIFACTORY_USERNAME}</username>
|
||||
<password>${env.ARTIFACTORY_PASSWORD}</password>
|
||||
</server>
|
||||
</servers>
|
||||
|
||||
</settings>
|
||||
Reference in New Issue
Block a user