Skip to content
This repository has been archived by the owner on Dec 20, 2023. It is now read-only.

Fix workflow version references #4

Fix workflow version references

Fix workflow version references #4

name: Perform Release with Artifactory
on:
workflow_call:
inputs:
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
secrets:
GH_ACTIONS_REPO_TOKEN:
required: true
GRADLE_ENTERPRISE_CACHE_USER:
required: true
GRADLE_ENTERPRISE_CACHE_PASSWORD:
required: true
GRADLE_ENTERPRISE_SECRET_ACCESS_KEY:
required: true
OSSRH_URL:
required: true
OSSRH_S01_TOKEN_USERNAME:
required: true
OSSRH_S01_TOKEN_PASSWORD:
required: true
OSSRH_STAGING_PROFILE_NAME:
required: true
GPG_PASSPHRASE:
required: true
GPG_PRIVATE_KEY:
required: true
JF_ARTIFACTORY_SPRING:
required: true
SPRING_RELEASE_SLACK_WEBHOOK_URL:
required: true
env:
GITHUB_TOKEN: ${{ secrets.GH_ACTIONS_REPO_TOKEN }}
jobs:
releaseVersion:
runs-on: ubuntu-latest
outputs:
releaseVersion: ${{ steps.release-version.outputs.releaseVersion }}
steps:
- uses: actions/checkout@v4
with:
show-progress: false
- name: Find Current Version to Release
id: release-version
run: |
if test -f pom.xml
then
CURRENT_VERSION=$(./mvnw help:evaluate -Dexpression="project.version" -q -DforceStdout)
else
CURRENT_VERSION=$(./gradlew properties --no-daemon --console=plain -q | grep "^version:" | awk '{printf $2}')
fi
export CANDIDATE_VERSION=${CURRENT_VERSION/-SNAPSHOT}
RELEASE_VERSION=$(gh api repos/$GITHUB_REPOSITORY/milestones --jq 'map(select(.title | startswith(env.CANDIDATE_VERSION))) | .[0] | .title')
if [ -z $RELEASE_VERSION ]
then
gh run cancel ${{ github.run_id }}
echo "::warning title=Nothing to release::No scheduled milestone for $CURRENT_VERSION version"
else
echo releaseVersion=$RELEASE_VERSION >> $GITHUB_OUTPUT
echo "::notice title=RELEASE VERSION::$RELEASE_VERSION"
fi
staging:
needs: releaseVersion
uses: ./.github/workflows/spring-stage-release.yml
with:
releaseVersion: ${{ needs.releaseVersion.outputs.releaseVersion }}
buildToolArgs: ${{ inputs.buildToolArgs }}
secrets: inherit
verify-staged:
needs: [releaseVersion, staging]
uses: ${{ github.repository }}/.github/workflows/verify-staged-artifacts.yml@main

Check failure on line 82 in .github/workflows/spring-artifactory-release.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/spring-artifactory-release.yml

Invalid workflow file

invalid value workflow reference: references to workflows must be prefixed with format 'owner/repository/' or './' for local workflows
with:
releaseVersion: ${{ needs.releaseVersion.outputs.releaseVersion }}
secrets: inherit
promote-milestone:
needs: [releaseVersion, staging, verify-staged]
if: ${{ (contains(needs.releaseVersion.outputs.releaseVersion, '-M') || contains(needs.releaseVersion.outputs.releaseVersion, '-RC')) }}
uses: ./.github/workflows/spring-artifactory-promote-milestone.yml
with:
buildName: ${{ needs.staging.outputs.buildName }}
buildNumber: ${{ needs.staging.outputs.buildNumber }}
secrets: inherit
promote-ga:
needs: [releaseVersion, staging, verify-staged]
if: ${{ !contains(needs.releaseVersion.outputs.releaseVersion, '-') }}
uses: ./.github/workflows/spring-artifactory-promote-central.yml
with:
buildName: ${{ needs.staging.outputs.buildName }}
buildNumber: ${{ needs.staging.outputs.buildNumber }}
secrets: inherit
finalize:
if: ${{ !(failure() || cancelled()) }}
needs: [releaseVersion, promote-milestone, promote-ga]
uses: ./.github/workflows/spring-finalize-release.yml
with:
milestone: ${{ needs.releaseVersion.outputs.releaseVersion }}
secrets: inherit