This repository has been archived by the owner on Dec 20, 2023. It is now read-only.
Move workflows to the .github/workflows
dir
#1
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: Stage Release with Gradle or Maven to Artifactory | ||
on: | ||
workflow_call: | ||
inputs: | ||
releaseVersion: | ||
description: 'Release version like 3.0.0-M1, 3.1.0-RC1, 3.2.0 etc.' | ||
required: true | ||
type: string | ||
buildToolArgs: | ||
description: 'Additional Maven or Gradle command arguments: tasks, goals, plugins etc. The `install` for Maven is included. The `build` and `artifactoryPublish` for Gradle are included.' | ||
required: false | ||
type: string | ||
outputs: | ||
buildName: | ||
description: 'Artifactory Build Name' | ||
value: ${{ jobs.build-info.outputs.buildName }} | ||
buildNumber: | ||
description: 'Artifactory Build Number' | ||
value: ${{ jobs.build-info.outputs.buildNumber }} | ||
env: | ||
BUILD_TOOLS_REPO: artembilan/spring-messaging-build-tools | ||
jobs: | ||
maven-or-gradle: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
isMaven: ${{ steps.is-maven.outputs.isMaven }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
show-progress: false | ||
- name: Check if project is Maven-based | ||
id: is-maven | ||
run: | | ||
if test -f pom.xml | ||
then | ||
echo isMaven=true >> $GITHUB_OUTPUT | ||
else | ||
echo isMaven=false >> $GITHUB_OUTPUT | ||
fi | ||
staging-with-gradle: | ||
needs: maven-or-gradle | ||
if: ${{ needs.maven-or-gradle.outputs.isMaven == 'false' }} | ||
uses: $BUILD_TOOLS_REPO/.github/workflows/spring-artifactory-gradle-release-staging.yml@main | ||
Check failure on line 50 in .github/workflows/spring-stage-release.yml GitHub Actions / .github/workflows/spring-stage-release.ymlInvalid workflow file
|
||
with: | ||
releaseVersion: ${{ inputs.releaseVersion }} | ||
gradleTasks: ${{ inputs.buildToolArgs }} | ||
secrets: inherit | ||
staging-with-maven: | ||
needs: maven-or-gradle | ||
if: ${{ needs.maven-or-gradle.outputs.isMaven == 'true' }} | ||
uses: $BUILD_TOOLS_REPO/.github/workflows/spring-artifactory-maven-release-staging.yml@main | ||
with: | ||
releaseVersion: ${{ inputs.releaseVersion }} | ||
mavenArgs: ${{ inputs.buildToolArgs }} | ||
secrets: inherit | ||
build-info: | ||
needs: [staging-with-gradle, staging-with-maven] | ||
if: ${{ !(failure() || cancelled()) }} | ||
runs-on: ubuntu-latest | ||
outputs: | ||
buildName: ${{ steps.output-build-info.outputs.buildName }} | ||
buildNumber: ${{ steps.output-build-info.outputs.buildNumber }} | ||
steps: | ||
- name: Output Build Info | ||
id: output-build-info | ||
run: | | ||
if [ ${{ needs.staging-with-gradle.outputs.buildName }} ] | ||
then | ||
buildName=${{ needs.staging-with-gradle.outputs.buildName }} | ||
buildNumber=${{ needs.staging-with-gradle.outputs.buildNumber }} | ||
else | ||
buildName=${{ needs.staging-with-maven.outputs.buildName }} | ||
buildNumber=${{ needs.staging-with-maven.outputs.buildNumber }} | ||
fi | ||
echo buildName=$buildName >> $GITHUB_OUTPUT | ||
echo buildNumber=$buildNumber >> $GITHUB_OUTPUT | ||
echo "::notice title=Artifactory Build Name & Number::$buildName/$buildNumber" |