Skip to content

Commit fabe8cc

Browse files
committed
GitHub Actions workflows tweaks
Signed-off-by: Peter Skopek <[email protected]>
1 parent 3ef279a commit fabe8cc

File tree

4 files changed

+24
-106
lines changed

4 files changed

+24
-106
lines changed

.github/workflows/release.yml

+23-22
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ on:
1313
description: Set to true to prevent maven deploy plugin to actually deploy the artifacts.
1414
required: true
1515
default: false
16+
type: boolean
1617

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

@@ -22,45 +23,45 @@ defaults:
2223

2324
jobs:
2425

25-
show-inputs:
26+
repo-prep:
27+
name: Prepare repository
2628
runs-on: ubuntu-latest
2729
steps:
28-
- run: |
30+
- name: Show-inputs
31+
run: |
2932
echo "Version: ${{ inputs.version }} " >> $GITHUB_STEP_SUMMARY
3033
echo "Release branch: ${{ inputs.branch }} " >> $GITHUB_STEP_SUMMARY
3134
echo "Workflow branch: ${{ github.ref_name }} " >> $GITHUB_STEP_SUMMARY
3235
echo "Deploy skip: ${{ inputs.deploy-skip }} " >> $GITHUB_STEP_SUMMARY
33-
- name: Checkout repository
36+
- name: Checkout
3437
uses: actions/checkout@v4
3538
with:
3639
ref: ${{ inputs.branch }}
37-
38-
env:
39-
uses: ./.github/workflows/x-env.yml
40-
41-
create-tags:
42-
name: Create tags
43-
needs: [env]
44-
uses: ./.github/workflows/x-create-tags.yml
45-
with:
46-
tag: ${{ github.event.inputs.version }}
47-
branch: ${{ github.event.inputs.branch }}
48-
set-versions: true
49-
secrets:
50-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
- name: Maven environment setup
41+
run: |
42+
cat $GITHUB_WORKSPACE/.github/env/release-env | sed -r '/^\s*$/d' >> $GITHUB_ENV
43+
- name: Create version change commit
44+
run: |
45+
./set-version.sh ${{ inputs.version }}
46+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
47+
git config --global user.name "github-actions[bot]"
48+
git commit -a -m "Set version to ${{ inputs.version }}"
49+
- name: Create tag commit
50+
run: git tag --force ${{ inputs.version }}
51+
- name: Push tag with version changes
52+
run: git push --force origin refs/tags/${{ inputs.version }}
5153

5254
keycloak-client:
5355
name: Keycloak Client
54-
needs: [env, create-tags]
56+
if: ${{ !inputs.deploy-skip }}
57+
needs: repo-prep
5558
uses: ./.github/workflows/x-keycloak-client.yml
5659
with:
5760
mvn-url: ${{ needs.env.outputs.mvn-releases-url }}
58-
tag: ${{ github.event.inputs.version }}
59-
deploy-skip: ${{ needs.env.outputs.deploy-skip }}
61+
tag: ${{ inputs.version }}
62+
deploy-skip: ${{ inputs.deploy-skip }}
6063
secrets:
61-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6264
MVN_USERNAME: ${{ secrets.MVN_USERNAME }}
6365
MVN_TOKEN: ${{ secrets.MVN_TOKEN }}
6466
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
6567
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
66-

.github/workflows/x-create-tags.yml

-51
This file was deleted.

.github/workflows/x-env.yml

-29
This file was deleted.

.github/workflows/x-keycloak-client.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,11 @@ on:
1717
type: string
1818
default: false
1919
path-final:
20-
description: "Patch where the final tag will be checked out"
20+
description: "Path where the final tag will be checked out"
2121
required: false
2222
type: string
2323
default: keycloak-client-final
2424
secrets:
25-
GH_TOKEN:
26-
required: true
2725
MVN_USERNAME:
2826
required: true
2927
MVN_TOKEN:
@@ -49,7 +47,6 @@ jobs:
4947
java-version: 17
5048
server-id: kc-rel-repository
5149
server-username: MAVEN_USERNAME
52-
server-username: MAVEN_USERNAME
5350
server-password: MAVEN_PASSWORD
5451
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
5552
gpg-passphrase: MAVEN_GPG_PASSPHRASE

0 commit comments

Comments
 (0)