Skip to content

Commit

Permalink
Merge some steps, address some comments
Browse files Browse the repository at this point in the history
Signed-off-by: mposolda <[email protected]>
  • Loading branch information
mposolda committed Dec 13, 2024
1 parent b25d2be commit a533d0f
Showing 1 changed file with 15 additions and 22 deletions.
37 changes: 15 additions & 22 deletions .github/workflows/x-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,34 +29,36 @@ defaults:

jobs:

create-tags:
release-impl:
runs-on: ubuntu-latest
# TODO:mposolda Needed for "gh"
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
check-latest: true

- name: Create version commit
if: ${{ !inputs.nightly }}
run: |
./set-version.sh ${{ inputs.tag }}
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git commit -a -m "Set version to ${{ inputs.tag }}"
npm version ${{ inputs.tag }} -m "Set version to ${{ inputs.tag }}"
- name: Tag commit
run: git tag ${{ inputs.tag }}

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

create-gh-releases:
runs-on: ubuntu-latest
needs: [create-tags]
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
steps:
- name: Check if release exists
id: release-exists
run: >
Expand All @@ -72,21 +74,12 @@ jobs:
if: env.release-exists == 'false'
run: gh release create ${{ inputs.tag }} --repo ${{ inputs.gh-org }}/keycloak-nodejs-connect --title ${{ inputs.tag }} --draft ${{ inputs.nightly && '--prerelease' || '' }}

release-on-github:
runs-on: ubuntu-latest
needs: [create-gh-releases]
steps:
# TODO:mposolda is this needed?
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ inputs.tag }}

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 22
check-latest: true

- name: Create package tarball
run: |
npm pack
Expand All @@ -103,7 +96,7 @@ jobs:

publish-gh-release:
runs-on: ubuntu-latest
needs: [release-on-github]
needs: [release-impl]
steps:
- name: Publish release
run: gh release edit ${{ inputs.tag }} --repo ${{ inputs.gh-org }}/keycloak-nodejs-connect --draft=false
Expand All @@ -112,7 +105,7 @@ jobs:

publish-npm:
runs-on: ubuntu-latest
needs: [release-on-github]
needs: [release-impl]
if: ${{ !inputs.nightly }}
steps:
- name: Download archive
Expand Down

0 comments on commit a533d0f

Please sign in to comment.