From 647f13830eaac844103c6f516901c6d5f8469364 Mon Sep 17 00:00:00 2001 From: yshrsmz Date: Sat, 11 Nov 2023 16:19:55 +0900 Subject: [PATCH 1/3] build: add release-please action --- .github/workflows/pr-title-validation.yml | 0 .github/workflows/release-please.yml | 35 +++++++++++++++++++++++ gradle.properties | 2 ++ 3 files changed, 37 insertions(+) create mode 100644 .github/workflows/pr-title-validation.yml create mode 100644 .github/workflows/release-please.yml diff --git a/.github/workflows/pr-title-validation.yml b/.github/workflows/pr-title-validation.yml new file mode 100644 index 0000000..e69de29 diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 0000000..64cfa1a --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,35 @@ +name: release-please + +on: + push: + branches: + - main + +permissions: {} + +jobs: + release_please: + + runs-on: ubuntu-latest + + outputs: + release_created: ${{ steps.release.outputs.release_created }} + + steps: + - uses: google-github-actions/release-please-action@v3.7.11 + id: release + with: + changelog-types: | + [ + {"type":"build","section":"Build System","hidden":false}, + {"type":"chore","section":"Miscellaneous","hidden":false}, + {"type":"feat","section":"Features","hidden":false}, + {"type":"fix","section":"Bug Fixes","hidden":false}, + {"type":"perf","section":"Performance Improvements","hidden":false}, + {"type":"refactor","section":"Refactoring","hidden":false}, + {"type":"revert","section":"Reverts","hidden":false} + ] + release-type: simple + extra-files: | + ./gradle.properties + token: ${{ secrets.WORKFLOW_TOKEN }} diff --git a/gradle.properties b/gradle.properties index fd61232..6ee476b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,9 @@ kotlin.code.style=official # GROUP=com.codingfeline.buildkonfig +# x-release-please-start-version VERSION_NAME=0.15.0 +# x-release-please-end # POM_URL=https://github.com/yshrsmz/BuildKonfig/ POM_SCM_URL=https://github.com/yshrsmz/BuildKonfig/ From 8a91639993cca446406c7dc3d3c28cbf8317bcc6 Mon Sep 17 00:00:00 2001 From: yshrsmz Date: Sat, 11 Nov 2023 16:20:15 +0900 Subject: [PATCH 2/3] ci: add pr-title-validation --- .github/workflows/pr-title-validation.yml | 38 +++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/.github/workflows/pr-title-validation.yml b/.github/workflows/pr-title-validation.yml index e69de29..e68c8de 100644 --- a/.github/workflows/pr-title-validation.yml +++ b/.github/workflows/pr-title-validation.yml @@ -0,0 +1,38 @@ +name: "pr-title-validation" + +on: + pull_request_target: + types: + - opened + - edited + - synchronize + +jobs: + validate_pr_title: + name: Validate PR title + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v5 + with: + # Use the following release types to match the same rules in the PR title lint + # https://github.com/googleapis/release-please/blob/main/src/changelog-notes.ts#L42-L55 + types: | + feat + fix + perf + deps + revert + docs + style + chore + refactor + test + build + ci + subjectPattern: ^(?![A-Z]).+$ + subjectPatternError: | + The subject "{subject}" found in the pull request title "{title}" + didn't match the configured pattern. Please ensure that the subject + doesn't start with an uppercase character. + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 396cab29cdc65f04edccf25a2ab823cb11b49ba5 Mon Sep 17 00:00:00 2001 From: yshrsmz Date: Sat, 11 Nov 2023 16:21:53 +0900 Subject: [PATCH 3/3] fix: final new line --- .github/workflows/pr-title-validation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-title-validation.yml b/.github/workflows/pr-title-validation.yml index e68c8de..a809c89 100644 --- a/.github/workflows/pr-title-validation.yml +++ b/.github/workflows/pr-title-validation.yml @@ -35,4 +35,4 @@ jobs: didn't match the configured pattern. Please ensure that the subject doesn't start with an uppercase character. env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}