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 fabe8cc
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 106 deletions.
45 changes: 23 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
description: Set to true to prevent maven deploy plugin to actually deploy the artifacts.
required: true
default: false
type: boolean

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

Expand All @@ -22,45 +23,45 @@ 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: Maven environment setup
run: |
cat $GITHUB_WORKSPACE/.github/env/release-env | sed -r '/^\s*$/d' >> $GITHUB_ENV
- 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]
if: ${{ !inputs.deploy-skip }}
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 }}
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 fabe8cc

Please sign in to comment.