|
| 1 | +name: ci |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - main |
| 6 | + pull_request: |
| 7 | + branches: |
| 8 | + - main |
| 9 | + |
| 10 | +jobs: |
| 11 | + test: |
| 12 | + runs-on: ubuntu-latest |
| 13 | + steps: |
| 14 | + - uses: actions/checkout@v4 |
| 15 | + - uses: actions/setup-node@v4 |
| 16 | + - uses: bahmutov/npm-install@v1 |
| 17 | + - run: npm run build-keycloak-theme |
| 18 | + |
| 19 | + check_if_version_upgraded: |
| 20 | + name: Check if version upgrade |
| 21 | + if: github.event_name == 'push' |
| 22 | + runs-on: ubuntu-latest |
| 23 | + needs: test |
| 24 | + outputs: |
| 25 | + from_version: ${{ steps.step1.outputs.from_version }} |
| 26 | + to_version: ${{ steps.step1.outputs.to_version }} |
| 27 | + is_upgraded_version: ${{ steps.step1.outputs.is_upgraded_version }} |
| 28 | + is_pre_release: ${{steps.step1.outputs.is_pre_release }} |
| 29 | + steps: |
| 30 | + - uses: garronej/ts-ci@v2.1.5 |
| 31 | + id: step1 |
| 32 | + with: |
| 33 | + action_name: is_package_json_version_upgraded |
| 34 | + branch: ${{ github.head_ref || github.ref }} |
| 35 | + |
| 36 | + create_github_release: |
| 37 | + runs-on: ubuntu-latest |
| 38 | + needs: check_if_version_upgraded |
| 39 | + if: needs.check_if_version_upgraded.outputs.is_upgraded_version == 'true' |
| 40 | + steps: |
| 41 | + - uses: actions/checkout@v4 |
| 42 | + - uses: actions/setup-node@v4 |
| 43 | + - uses: bahmutov/npm-install@v1 |
| 44 | + - run: npm run build-keycloak-theme |
| 45 | + - uses: softprops/action-gh-release@v2 |
| 46 | + with: |
| 47 | + name: Release v${{ needs.check_if_version_upgraded.outputs.to_version }} |
| 48 | + tag_name: v${{ needs.check_if_version_upgraded.outputs.to_version }} |
| 49 | + target_commitish: ${{ github.head_ref || github.ref }} |
| 50 | + generate_release_notes: true |
| 51 | + draft: false |
| 52 | + prerelease: ${{ needs.check_if_version_upgraded.outputs.is_pre_release == 'true' }} |
| 53 | + files: dist_keycloak/keycloak-theme-*.jar |
| 54 | + env: |
| 55 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments