Release #72
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: Release | |
on: | |
workflow_dispatch: | |
inputs: | |
branch: | |
description: Release branch (needed for major and minor releases) | |
required: true | |
version: | |
description: Release version | |
required: true | |
deploy-skip: | |
description: Skip artifacts maven repository deployment (maven.deploy.skip) | |
required: true | |
default: false | |
type: boolean | |
concurrency: rel-${{ github.ref }} | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
release: | |
name: Release keycloak-client | |
runs-on: ubuntu-latest | |
steps: | |
- name: Show-inputs | |
run: | | |
echo "Version: ${{ inputs.version }} " >> $GITHUB_STEP_SUMMARY | |
echo "Release branch: ${{ inputs.branch }} " >> $GITHUB_STEP_SUMMARY | |
echo "Workflow branch: ${{ github.ref_name }} " >> $GITHUB_STEP_SUMMARY | |
echo "Deploy skip: ${{ inputs.deploy-skip }} " >> $GITHUB_STEP_SUMMARY | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ inputs.branch }} | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 17 | |
server-id: kc-rel-repository | |
server-username: MAVEN_USERNAME | |
server-password: MAVEN_PASSWORD | |
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} | |
gpg-passphrase: MAVEN_GPG_PASSPHRASE | |
- name: Create version change commit | |
run: | | |
./set-version.sh ${{ inputs.version }} | |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config --global user.name "github-actions[bot]" | |
git commit -a -m "Set version to ${{ inputs.version }}" | |
- name: Create tag commit | |
run: git tag --force ${{ inputs.version }} | |
- name: Push tag with version changes | |
run: git push --force origin refs/tags/${{ inputs.version }} | |
- name: Deploy to Maven | |
env: | |
MAVEN_ID: kc-rel-repository | |
MAVEN_URL: https://s01.oss.sonatype.org/service/local/repositories/releases/content/ | |
MAVEN_USERNAME: ${{ secrets.MVN_USERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.MVN_TOKEN }} | |
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
run: | | |
MVN_HTTP_CONFIG="-Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3 -Dmaven.wagon.httpconnectionManager.ttlSeconds=120" | |
mvn -s ./.github/mvn-rel-settings.xml -nsu -B -Pgpg,jboss-release -Djboss.releases.repo.id=$MAVEN_ID -Dmaven.deploy.skip=${{ inputs.deploy-skip }} -Djboss.releases.repo.url=$MAVEN_URL -Djboss.snapshots.repo.id=$MAVEN_ID -Djboss.snapshots.repo.url=$MAVEN_URL -DskipTests -DskipTestsuite -DretryFailedDeploymentCount=10 -DautoReleaseAfterClose=true $MVN_HTTP_CONFIG clean deploy | tee deploy.log | |
- name: Show Maven artifacts | |
run: | | |
cat deploy.log | grep "Uploaded to" | grep -o "https://[^ ]*" | grep -v '.xml$' | grep -v '.asc$' | grep -v '.pom$' | grep -v 'javadoc.jar$' | grep -v 'sources.jar$' | xargs -I {} echo "{} " >> $GITHUB_STEP_SUMMARY | |