Skip to content

feat: ci -> version #30

feat: ci -> version

feat: ci -> version #30

Workflow file for this run

name: Build and deploy theme
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
version:
runs-on: ubuntu-latest
outputs:
package_version: ${{ steps.package_version.outputs.to_version }}
steps:
- uses: actions/checkout@v4
- id: package_version
run: echo "to_version=$(jq -r '.version' package.json)" >> $GITHUB_STATE
build:
runs-on: ubuntu-latest
if: github.event.head_commit.author.name != 'actions'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22"
- uses: bahmutov/npm-install@v1
- run: yarn build
- run: chmod +x ./package.sh && ./package.sh
- uses: actions/upload-artifact@v4
with:
name: standalone_keycloak_theme
path: build/*.jar
create_github_release:
runs-on: ubuntu-latest
needs:
- build
- version
# We create a release only if the version have been upgraded and we are on a default branch
# PR on the default branch can release beta but not real release
if: github.event_name == 'push'
steps:
- run: mkdir jars
- uses: actions/download-artifact@v4
with:
name: standalone_keycloak_theme
- run: mv *.jar jars/
- uses: softprops/action-gh-release@v2
with:
name: Release ${{ needs.version.outputs.package_version }}
tag_name: v${{ needs.version.outputs.package_version }}
target_commitish: ${{ github.head_ref || github.ref }}
generate_release_notes: true
files: |
jars/*.jar
draft: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}