-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setting up release workflows for keycloak-client project.
Closes #23
- Loading branch information
Showing
11 changed files
with
353 additions
and
25 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
gh-org=keycloak | ||
|
||
mvn-releases-url=https://s01.oss.sonatype.org/service/local/repositories/releases/content/ | ||
mvn-snapshots-url=https://s01.oss.sonatype.org/content/repositories/snapshots/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
|
||
<?xml version="1.0" encoding="UTF-8"?> | ||
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> | ||
<activeProfiles> | ||
<activeProfile>keycloak-rel</activeProfile> | ||
</activeProfiles> | ||
<profiles> | ||
<profile> | ||
<id>keycloak-rel</id> | ||
<repositories> | ||
<repository> | ||
<id>${env.MAVEN_ID}</id> | ||
<url>${env.MAVEN_URL}</url> | ||
<snapshots> | ||
<enabled>true</enabled> | ||
</snapshots> | ||
<releases> | ||
<enabled>true</enabled> | ||
</releases> | ||
</repository> | ||
</repositories> | ||
</profile> | ||
</profiles> | ||
<servers> | ||
<server> | ||
<id>${env.MAVEN_ID}</id> | ||
<username>${env.MAVEN_USERNAME}</username> | ||
<password>${env.MAVEN_PASSWORD}</password> | ||
</server> | ||
<server> | ||
<id>gpg.passphrase</id> | ||
<passphrase>${env.MAVEN_GPG_PASSPHRASE}</passphrase> | ||
</server> | ||
</servers> | ||
|
||
</settings> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Keycloak Client Nightly Release | ||
|
||
on: | ||
schedule: | ||
- cron: '0 2 * * *' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
server-id: ossrh | ||
server-username: MAVEN_USERNAME | ||
server-password: MAVEN_PASSWORD | ||
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} | ||
gpg-passphrase: MAVEN_GPG_PASSPHRASE | ||
|
||
- name: Deploy to Maven | ||
env: | ||
MAVEN_USERNAME: ${{ secrets.MVN_USERNAME }} | ||
MAVEN_PASSWORD: ${{ secrets.MVN_TOKEN }} | ||
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | ||
run: | | ||
mvn -nsu -B -Pgpg,jboss-release -DskipTests -DretryFailedDeploymentCount=10 -DautoReleaseAfterClose=true deploy |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,66 @@ | ||
name: Keycloak Client Nightly Release | ||
name: Release | ||
|
||
on: | ||
schedule: | ||
- cron: '0 2 * * *' | ||
workflow_dispatch: | ||
inputs: | ||
branch: | ||
description: Release branch (needed for major and minor releases) | ||
required: true | ||
version: | ||
description: Release version | ||
required: true | ||
deploy-skip: | ||
description: Set to true to prevent maven deploy plugin to actually deploy the artifacts. | ||
required: true | ||
default: false | ||
|
||
concurrency: rel-${{ github.ref }} | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
release: | ||
|
||
show-inputs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
server-id: ossrh | ||
server-username: MAVEN_USERNAME | ||
server-password: MAVEN_PASSWORD | ||
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} | ||
gpg-passphrase: MAVEN_GPG_PASSPHRASE | ||
|
||
- name: Deploy to Maven | ||
env: | ||
MAVEN_USERNAME: ${{ secrets.MVN_USERNAME }} | ||
MAVEN_PASSWORD: ${{ secrets.MVN_TOKEN }} | ||
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | ||
run: | | ||
mvn -nsu -B -Pgpg,jboss-release -DskipTests -DretryFailedDeploymentCount=10 -DautoReleaseAfterClose=true deploy | ||
- 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 "Dry run: ${{ inputs.dry-run }} " >> $GITHUB_STEP_SUMMARY | ||
env: | ||
uses: ./.github/workflows/x-env.yml | ||
|
||
create-tags: | ||
name: Create tags | ||
needs: [env] | ||
uses: ./.github/workflows/x-create-tags.yml | ||
with: | ||
gh-org: ${{ needs.env.outputs.gh-org }} | ||
tag: ${{ github.event.inputs.version }} | ||
branch: ${{ github.event.inputs.branch }} | ||
set-versions: true | ||
secrets: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
keycloak-client: | ||
name: Keycloak Client | ||
needs: [env, create-tags] | ||
uses: ./.github/workflows/x-keycloak-client.yml | ||
with: | ||
gh-org: ${{ needs.env.outputs.gh-org }} | ||
mvn-url: ${{ needs.env.outputs.mvn-releases-url }} | ||
version: ${{ github.event.inputs.version }} | ||
tag: ${{ github.event.inputs.version }} | ||
deploy-skip: ${{ needs.env.outputs.deploy-skip }} | ||
secrets: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
MVN_USERNAME: ${{ secrets.MVN_USERNAME }} | ||
MVN_TOKEN: ${{ secrets.MVN_TOKEN }} | ||
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | ||
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
|
||
name: X Create tags | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
gh-org: | ||
required: true | ||
type: string | ||
tag: | ||
required: true | ||
type: string | ||
branch: | ||
required: false | ||
type: string | ||
default: main | ||
set-versions: | ||
required: false | ||
type: boolean | ||
default: false | ||
secrets: | ||
GH_TOKEN: | ||
required: true | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
create-tags: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
repository: | ||
- keycloak-client | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: "${{ inputs.gh-org }}/${{ matrix.repository }}" | ||
token: ${{ secrets.GH_TOKEN }} | ||
path: ${{ matrix.repository }} | ||
ref: ${{ inputs.branch }} | ||
|
||
- name: Create version commit | ||
if: inputs.set-versions | ||
working-directory: ${{ matrix.repository }} | ||
run: | | ||
./set-version.sh ${{ inputs.tag }} | ||
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.tag }}" | ||
- name: Tag commit | ||
working-directory: ${{ matrix.repository }} | ||
run: git tag --force ${{ inputs.tag }} | ||
|
||
- name: Push changes | ||
working-directory: ${{ matrix.repository }} | ||
run: git push --force origin refs/tags/${{ inputs.tag }} | ||
|
||
show-tags: | ||
name: Show Git tags | ||
runs-on: ubuntu-latest | ||
needs: [create-tags] | ||
steps: | ||
- run: | | ||
echo "https://github.com/${{ inputs.gh-org }}/keycloak-client/tree/${{ inputs.tag }} " >> $GITHUB_STEP_SUMMARY |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: X Environment setup | ||
|
||
on: | ||
workflow_call: | ||
outputs: | ||
gh-org: | ||
description: "GitHub Organization" | ||
value: ${{ jobs.env.outputs.gh-org }} | ||
mvn-releases-url: | ||
description: "Maven Releases URL" | ||
value: ${{ jobs.env.outputs.mvn-releases-url }} | ||
mvn-snapshots-url: | ||
description: "Maven Snapshots URL" | ||
value: ${{ jobs.env.outputs.mvn-snapshots-url }} | ||
deploy-skip: | ||
value: ${{ jobs.env.outputs.depoly-skip }} | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
env: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
gh-org: ${{ env.gh-org }} | ||
mvn-releases-url: ${{ env.mvn-releases-url }} | ||
mvn-snapshots-url: ${{ env.mvn-snapshots-url }} | ||
deploy-skip: ${{ env.deploy-skip }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- id: load-env | ||
run: | | ||
cat .github/env/release-env | sed -r '/^\s*$/d' >> $GITHUB_ENV |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: X Keycloak Client | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
gh-org: | ||
required: true | ||
type: string | ||
mvn-url: | ||
required: true | ||
type: string | ||
version: | ||
required: true | ||
type: string | ||
tag: | ||
required: true | ||
type: string | ||
deploy-skip: | ||
required: false | ||
type: string | ||
default: false | ||
secrets: | ||
GH_TOKEN: | ||
required: true | ||
MVN_USERNAME: | ||
required: true | ||
MVN_TOKEN: | ||
required: true | ||
GPG_PASSPHRASE: | ||
required: true | ||
GPG_PRIVATE_KEY: | ||
required: true | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Setup Java | ||
uses: actions/setup-java@v3 | ||
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: Checkout Repository | ||
uses: actions/checkout@v3.0.0 | ||
with: | ||
repository: '${{ inputs.gh-org }}/keycloak-client' | ||
token: ${{ secrets.GH_TOKEN }} | ||
ref: ${{ inputs.tag }} | ||
|
||
- name: Deploy to Maven | ||
env: | ||
MAVEN_ID: kc-rel-repository | ||
MAVEN_URL: ${{ inputs.mvn-url }} | ||
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,all -Djboss.releases.repo.id=$MAVEN_ID -Dmaven.deploy.skip=${{ inputs.deploy-skip }} -Djboss.releases.repo.url=${{ inputs.mvn-url }} -Djboss.snapshots.repo.id=$MAVEN_ID -Djboss.snapshots.repo.url=${{ inputs.mvn-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 |
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
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
Oops, something went wrong.