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: 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 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_ACTIONS_REPO_TOKEN }} | ||
BUILD_TOOLS_REPO: artembilan/spring-messaging-build-tools | ||
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: $BUILD_TOOLS_REPO/.github/workflows/spring-stage-release.yml@main | ||
Check failure on line 49 in .github/workflows/spring-artifactory-release.yml GitHub Actions / .github/workflows/spring-artifactory-release.ymlInvalid workflow file
|
||
with: | ||
releaseVersion: ${{ needs.releaseVersion.outputs.releaseVersion }} | ||
buildToolArgs: ${{ inputs.buildToolArgs }} | ||
secrets: inherit | ||
verify-staged: | ||
needs: [releaseVersion, staging] | ||
uses: ./.github/workflows/verify-staged-artifacts.yml | ||
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: $BUILD_TOOLS_REPO/.github/workflows/spring-artifactory-promote-milestone.yml@main | ||
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: $BUILD_TOOLS_REPO/.github/workflows/spring-artifactory-promote-central.yml@main | ||
with: | ||
buildName: ${{ needs.staging.outputs.buildName }} | ||
buildNumber: ${{ needs.staging.outputs.buildNumber }} | ||
secrets: inherit | ||
finalize: | ||
if: ${{ !(failure() || cancelled()) }} | ||
needs: [releaseVersion, promote-milestone, promote-ga] | ||
uses: $BUILD_TOOLS_REPO/.github/workflows/spring-finalize-release.yml@main | ||
with: | ||
milestone: ${{ needs.releaseVersion.outputs.releaseVersion }} | ||
secrets: inherit |