Bump komponenter-versjon #405
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: release | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| cluster: | |
| description: Cluster | |
| required: true | |
| default: dev-gcp | |
| type: choice | |
| options: | |
| - dev-gcp | |
| - prod-gcp | |
| push: | |
| branches: [ main ] | |
| paths-ignore: | |
| - '.github/**' | |
| - '*.md' | |
| - 'CODEOWNERS' | |
| jobs: | |
| gradle: | |
| ## push til main eller etter branch (e.g. dependabot) er merget | |
| if: github.event.pull_request.merged || github.event_name == 'push' || github.event_name == 'workflow_dispatch' | |
| permissions: | |
| contents: write | |
| actions: read | |
| checks: write | |
| id-token: write | |
| uses: navikt/aap-workflows/.github/workflows/gradle-build.yml@main | |
| secrets: inherit | |
| publiser-kontrakt: | |
| needs: gradle | |
| permissions: | |
| contents: write | |
| packages: write | |
| id-token: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| # Ha denne tidlig, så action kan skippe raskt om ingen endringer. | |
| - uses: paulhatch/semantic-version@v5.4.0 | |
| id: tag | |
| with: | |
| change_path: "kontrakt/" | |
| bump_each_commit: true | |
| tag_prefix: "" | |
| bump_each_commit_patch_pattern: '' | |
| major_pattern: "(MAJOR)" # If major bump, include this in commit message | |
| - uses: actions/setup-java@v5 | |
| if: ${{ steps.tag.outputs.changed == 'true' }} | |
| with: | |
| java-version: 21 | |
| distribution: 'temurin' | |
| - uses: gradle/actions/setup-gradle@v4 | |
| with: | |
| gradle-version: wrapper | |
| - id: notes | |
| if: ${{ steps.tag.outputs.changed == 'true' }} | |
| run: | | |
| randomDelimiter=${RANDOM} | |
| text=$(git --no-pager log $(git describe --tags --abbrev=0)..HEAD --pretty=format:"%h %s") | |
| echo 'CHANGELOG<<$randomDelimiter' >> $GITHUB_OUTPUT | |
| echo $text >> $GITHUB_OUTPUT | |
| echo '$randomDelimiter' >> $GITHUB_OUTPUT | |
| - uses: softprops/action-gh-release@v2 | |
| if: ${{ steps.tag.outputs.changed == 'true' }} | |
| id: create_release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ steps.tag.outputs.version }} | |
| name: ${{ steps.tag.outputs.version }} | |
| body: | | |
| Endringer siden sist: | |
| ${{ steps.notes.outputs.CHANGELOG }} | |
| - if: ${{ steps.tag.outputs.changed == 'true' }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| ./gradlew -Pversion=${{ steps.tag.outputs.version }} publish | |
| dev: | |
| ## push til main eller etter branch (e.g. dependabot) er merget | |
| if: github.event.pull_request.merged || github.event_name == 'push' || github.event.inputs.cluster == 'dev-gcp' | |
| permissions: | |
| contents: read | |
| id-token: write | |
| needs: gradle | |
| concurrency: | |
| group: deploy-dev | |
| uses: navikt/aap-workflows/.github/workflows/deploy.yml@main | |
| secrets: inherit | |
| with: | |
| cluster: dev-gcp | |
| manifest: .nais/app-dev.yml | |
| prod: | |
| ## push til main eller etter branch (e.g. dependabot) er merget | |
| if: github.event.pull_request.merged || github.event_name == 'push' || github.event.inputs.cluster == 'prod-gcp' | |
| permissions: | |
| contents: read | |
| id-token: write | |
| needs: dev | |
| concurrency: | |
| group: deploy-prod | |
| uses: navikt/aap-workflows/.github/workflows/deploy.yml@main | |
| secrets: inherit | |
| with: | |
| cluster: prod-gcp | |
| manifest: .nais/app-prod.yml |