Skip to content

Commit

Permalink
GitHub Actions workflows tweaks
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Skopek <pskopek@redhat.com>
  • Loading branch information
pskopek committed Sep 5, 2024
1 parent 3ef279a commit 0db2759
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 108 deletions.
49 changes: 25 additions & 24 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,14 @@ on:
description: Release version
required: true
deploy-skip:
description: Set to true to prevent maven deploy plugin to actually deploy the artifacts.
description: Skip artifacts maven repository deployment (maven.deploy.skip)
required: true
default: false
type: boolean

env:
mvn-releases-url: https://s01.oss.sonatype.org/service/local/repositories/releases/content/
mvn-snapshots-url: https://s01.oss.sonatype.org/content/repositories/snapshots/

concurrency: rel-${{ github.ref }}

Expand All @@ -22,45 +27,41 @@ defaults:

jobs:

show-inputs:
repo-prep:
name: Prepare repository
runs-on: ubuntu-latest
steps:
- run: |
- 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 repository
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}

env:
uses: ./.github/workflows/x-env.yml

create-tags:
name: Create tags
needs: [env]
uses: ./.github/workflows/x-create-tags.yml
with:
tag: ${{ github.event.inputs.version }}
branch: ${{ github.event.inputs.branch }}
set-versions: true
secrets:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- 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 }}

keycloak-client:
name: Keycloak Client
needs: [env, create-tags]
needs: repo-prep
uses: ./.github/workflows/x-keycloak-client.yml
with:
mvn-url: ${{ needs.env.outputs.mvn-releases-url }}
tag: ${{ github.event.inputs.version }}
deploy-skip: ${{ needs.env.outputs.deploy-skip }}
mvn-url: https://s01.oss.sonatype.org/service/local/repositories/releases/content/
tag: ${{ inputs.version }}
deploy-skip: ${{ inputs.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 }}

51 changes: 0 additions & 51 deletions .github/workflows/x-create-tags.yml

This file was deleted.

29 changes: 0 additions & 29 deletions .github/workflows/x-env.yml

This file was deleted.

5 changes: 1 addition & 4 deletions .github/workflows/x-keycloak-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@ on:
type: string
default: false
path-final:
description: "Patch where the final tag will be checked out"
description: "Path where the final tag will be checked out"
required: false
type: string
default: keycloak-client-final
secrets:
GH_TOKEN:
required: true
MVN_USERNAME:
required: true
MVN_TOKEN:
Expand All @@ -49,7 +47,6 @@ jobs:
java-version: 17
server-id: kc-rel-repository
server-username: MAVEN_USERNAME
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
Expand Down

0 comments on commit 0db2759

Please sign in to comment.