diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bd8d25f..729d119 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,18 +1,15 @@ -name: Release +name: Publish Release on: workflow_dispatch: inputs: version: - description: "Release version (e.g. 1.1.0)" + description: 'Version to release' required: true after-version: - description: "Next snapshot version (e.g. 1.2.0-SNAPSHOT)" + description: 'Snapshot version after release' required: true -permissions: - contents: write - jobs: set-release-version: uses: ./.github/workflows/set-version.yml @@ -22,28 +19,36 @@ jobs: build: needs: set-release-version runs-on: ubuntu-latest + permissions: + contents: write steps: - - uses: actions/checkout@v6 + - name: Checkout repository + uses: actions/checkout@v6 with: ref: ${{ github.ref }} - fetch-depth: 0 - - uses: actions/setup-java@v5 + - name: Set up Gradle + uses: gradle/actions/setup-gradle@v5 + + - name: Set up JDK 21 + uses: actions/setup-java@v5 with: - distribution: temurin - java-version: 21 + java-version: '21' + distribution: 'temurin' - - uses: gradle/actions/setup-gradle@v5 + - name: Build with Gradle + run: ./gradlew build - - run: ./gradlew build - - - name: Generate changelog + - name: Build Changelog id: changelog uses: mikepenz/release-changelog-builder-action@v6 with: - commitMode: true + mode: COMMIT + toTag: ${{ github.ref }} configurationJson: | { + "template": "#{{CHANGELOG}}", + "commit_template": "- [`#{{SHORT_MERGE_SHA}}`](https://github.com/#{{OWNER}}/#{{REPO}}/commit/#{{MERGE_SHA}}) #{{TITLE}}", "categories": [ { "title": "## Features", "labels": ["feat", "feature"] }, { "title": "## Fixes", "labels": ["fix", "bug"] }, @@ -53,16 +58,14 @@ jobs: { "title": "## Build", "labels": ["build", "chore", "ci"] }, { "title": "## Other", "labels": [] } ], + "empty_template": "no changes", "label_extractor": [ { - "pattern": "^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\\([\\w\\-\\.]+\\))?(!)?: ([\\w ])+([\\s\\S]*)", + "pattern": "^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test){1}(\\([\\w\\-\\.]+\\))?(!)?: ([\\w ])+([\\s\\S]*)", "on_property": "title", - "method": "match", "target": "$1" } ], - "template": "#{{CHANGELOG}}", - "pr_template": "- [`#{{SHORT_MERGE_SHA}}`](https://github.com/#{{OWNER}}/#{{REPO}}/commit/#{{MERGE_SHA}}) #{{TITLE}}", "custom_placeholders": [ { "name": "SHORT_MERGE_SHA", diff --git a/.github/workflows/set-version.yml b/.github/workflows/set-version.yml index d5e6e70..fe35d3d 100644 --- a/.github/workflows/set-version.yml +++ b/.github/workflows/set-version.yml @@ -1,32 +1,35 @@ -name: Set Version +name: set-version on: workflow_dispatch: inputs: version: - description: "Version to set (e.g. 1.1.0 or 1.2.0-SNAPSHOT)" + description: 'Version to set' required: true workflow_call: inputs: version: - description: "Version to set" required: true type: string -permissions: - contents: write - jobs: set-version: + name: Set Version + + permissions: + contents: write + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - name: Checkout repository + uses: actions/checkout@v6 with: ref: ${{ github.ref }} - - name: Set version + - name: Set Version run: sed -i "s/version = \".*\"/version = \"${{ inputs.version }}\"/" build.gradle.kts - - uses: stefanzweifel/git-auto-commit-action@v7 + - name: Commit Version + uses: stefanzweifel/git-auto-commit-action@v7 with: - commit_message: "chore(release): bump version to ${{ inputs.version }}" + commit_message: 'chore(release): bump version to ${{ inputs.version }}'