Skip to content

Commit

Permalink
Commit 2 - adding release.yml
Browse files Browse the repository at this point in the history
Signed-off-by: mposolda <[email protected]>
  • Loading branch information
mposolda committed Dec 9, 2024
1 parent e01a778 commit 631fa22
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/release-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ jobs:
gh-org: mposolda
branch: main
tag: nightly
set-versions: false
secrets:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
21 changes: 21 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Release

on:
workflow_dispatch:
inputs:
version:
description: Release version
required: true

jobs:

release:
name: Release
uses: ./.github/workflows/x-release.yml
with:
gh-org: mposolda # TODO:mposolda remove or update this
branch: ${{ github.ref_name }}
tag: ${{ inputs.version }}
set-versions: true
secrets:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
37 changes: 36 additions & 1 deletion .github/workflows/x-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ on:
tag:
required: true
type: string
set-versions:
required: true
type: boolean
secrets:
GH_TOKEN:
required: true
Expand All @@ -34,4 +37,36 @@ jobs:
echo "Github organization: ${{ inputs.gh-org }} " >> $GITHUB_STEP_SUMMARY
echo "Branch: ${{ inputs.branch }} " >> $GITHUB_STEP_SUMMARY
echo "Target tag: ${{ inputs.tag }} " >> $GITHUB_STEP_SUMMARY
echo "Ref: ${{ github.ref }} " >> $GITHUB_STEP_SUMMARY
echo "Set versions: ${{ inputs.set-versions }} " >> $GITHUB_STEP_SUMMARY
release-impl:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
# repository: "${{ inputs.gh-org }}/keycloak-nodejs-connect"
# token: ${{ secrets.GH_TOKEN }}
ref: ${{ inputs.branch }}

- name: Create version commit
if: inputs.set-versions
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
run: git tag --force ${{ inputs.tag }}

- name: Push changes
run: git push --force origin refs/tags/${{ inputs.tag }}

show-output:
name: Show Output
runs-on: ubuntu-latest
needs: [release-impl]
steps:
- run: |
echo "https://github.com/${{ inputs.gh-org }}/keycloak-nodejs-connect/tree/${{ inputs.tag }} " >> $GITHUB_STEP_SUMMARY

0 comments on commit 631fa22

Please sign in to comment.