Perform release against version from branch

This commit is contained in:
Artem Bilan
2023-11-15 18:19:04 -05:00
parent 121b8b231c
commit 59c1400213
5 changed files with 56 additions and 9 deletions

View File

@@ -2,17 +2,13 @@ name: Release
on:
workflow_dispatch:
inputs:
releaseVersion:
description: 'Release version like 3.0.0-M1, 3.1.0-RC1, 3.2.0 etc.'
required: true
type: string
run-name: Release current version for branch ${{ github.ref_name }}
jobs:
release:
uses: spring-projects/spring-integration-aws/.github/workflows/spring-artifactory-release.yml@main
uses: spring-projects/spring-integration-aws/.github/workflows/spring-release-for-branch.yml@main
with:
releaseVersion: ${{ inputs.releaseVersion }}
buildToolArgs: dist
repositoryTeam: artembilan,garyrussell
secrets: inherit

View File

@@ -70,6 +70,8 @@ jobs:
echo JFROG_CLI_BUILD_NUMBER=$GITHUB_RUN_NUMBER >> $GITHUB_ENV
echo buildName=$buildName >> $GITHUB_OUTPUT
echo buildNumber=$JFROG_CLI_BUILD_NUMBER >> $GITHUB_OUTPUT
echo "::notice ::Artifactory Build Name=$JFROG_CLI_BUILD_NAME"
echo "::notice ::Artifactory Build Number=$JFROG_CLI_BUILD_NUMBER"
- name: Set Release Version
run: sed -i "s/version=.*/version=${{ inputs.releaseVersion }}/" gradle.properties

View File

@@ -31,6 +31,7 @@ jobs:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GH_ACTIONS_REPO_TOKEN }}
show-progress: false
- name: Set up JDK
uses: actions/setup-java@v3
@@ -60,6 +61,8 @@ jobs:
echo JFROG_CLI_BUILD_NUMBER=$GITHUB_RUN_NUMBER >> $GITHUB_ENV
echo buildName=$buildName >> $GITHUB_OUTPUT
echo buildNumber=$JFROG_CLI_BUILD_NUMBER >> $GITHUB_OUTPUT
echo "::notice ::Artifactory Build Name=$JFROG_CLI_BUILD_NAME"
echo "::notice ::Artifactory Build Number=$JFROG_CLI_BUILD_NUMBER"
- name: Set Release Version
run: |

View File

@@ -16,8 +16,6 @@ on:
required: false
type: string
run-name: Release version ${{ inputs.releaseVersion }}
jobs:
staging:
uses: spring-projects/spring-integration-aws/.github/workflows/spring-stage-release.yml@main

View File

@@ -0,0 +1,48 @@
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
repositoryTeam:
description: 'Comma-separate GitHub user names for repository team members to exclude from contributors'
required: false
type: string
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')
echo releaseVersion=$RELEASE_VERSION >> $GITHUB_OUTPUT
echo "::notice ::RELEASE VERSION=$RELEASE_VERSION"
perform-release:
needs: releaseVersion
uses: spring-projects/spring-integration-aws/.github/workflows/spring-artifactory-release.yml@main
with:
releaseVersion: ${{ needs.releaseVersion.outputs.releaseVersion }}
buildToolArgs: ${{ inputs.buildToolArgs }}
repositoryTeam: ${{ inputs.repositoryTeam }}
secrets: inherit