diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 0000000..2ac3ebe --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,81 @@ +# The labeler cannot read the pull request title, so the type comes from the +# branch prefix instead. A branch that matches nothing keeps no type label, which +# is what renovate and release-please branches want. +"type: feature": + - head-branch: [ '^feat/' ] + +"type: bug": + - head-branch: [ '^fix/' ] + +"type: docs": + - head-branch: [ '^docs/' ] + +"type: refactor": + - head-branch: [ '^refactor/' ] + +"type: test": + - head-branch: [ '^test/' ] + +"type: perf": + - head-branch: [ '^perf/' ] + +"type: chore": + - head-branch: [ '^(build|chore|ci|revert|style)/' ] + +"area: protocol": + - changed-files: + - any-glob-to-any-file: + - bytecodec/** + - network/** + - protocols.game/** + +# The login stack is small enough to drown in area: server and area: protocol, so +# it owns both of its modules. +"area: login": + - changed-files: + - any-glob-to-any-file: + - server.login/** + - protocols.login/** + +# The game systems live inside the server.game module, so the two areas split by +# package instead of by module. +"area: server": + - changed-files: + - any-glob-to-any-file: + - server.game/src/**/game/*.kt + - server.game/src/**/game/config/** + - server.game/src/**/game/db/** + - server.game/src/**/game/di/** + - server.game/src/**/game/handler/** + - server.game/src/**/game/services/** + - server.game/src/**/game/session/** + - server.game/src/**/game/storage/** + - server.game/src/main/resources/db/** + +"area: game": + - changed-files: + - any-glob-to-any-file: + - server.game/src/**/game/battle/** + - server.game/src/**/game/script/** + - server.game/src/**/game/world/** + +"area: codegen": + - changed-files: + - any-glob-to-any-file: + - codegen/** + - decomp/** + +"area: patcher": + - changed-files: + - any-glob-to-any-file: + - patcher/** + - keys/** + +"area: build": + - changed-files: + - any-glob-to-any-file: + - buildSrc/** + - gradle/** + - "*.gradle.kts" + - gradle.properties + - .github/** diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml new file mode 100644 index 0000000..45062b3 --- /dev/null +++ b/.github/workflows/label.yml @@ -0,0 +1,27 @@ +name: Label + +on: + pull_request_target: + types: [ opened, edited, reopened, synchronize ] + +permissions: + contents: read + pull-requests: write + +concurrency: + group: label-${{ github.event.pull_request.number }} + cancel-in-progress: true + +jobs: + label: + name: Type and area + runs-on: ubuntu-latest + steps: + # Never check out the pull request head in this job. pull_request_target + # runs with a write token even for forks, so running their code here would + # hand the token to the fork. + - name: Apply the labels + uses: actions/labeler@v5 + with: + configuration-path: .github/labeler.yml + sync-labels: true diff --git a/.github/workflows/todo.yml b/.github/workflows/todo.yml index 55c959c..36c8bb6 100644 --- a/.github/workflows/todo.yml +++ b/.github/workflows/todo.yml @@ -20,4 +20,4 @@ jobs: uses: alstr/todo-to-issue-action@v5 with: CLOSE_ISSUES: true - IDENTIFIERS: '[{"name": "TODO", "labels": []}, {"name": "FIXME", "labels": []}, {"name": "BUG", "labels": []}]' + IDENTIFIERS: '[{"name": "TODO", "labels": ["source: todo"]}, {"name": "FIXME", "labels": ["source: todo"]}, {"name": "BUG", "labels": ["source: todo", "type: bug"]}]' diff --git a/renovate.json b/renovate.json index 8abec59..45f30ce 100644 --- a/renovate.json +++ b/renovate.json @@ -24,7 +24,7 @@ "description": "Major updates always wait for manual review", "matchUpdateTypes": ["major"], "automerge": false, - "addLabels": ["major"] + "addLabels": ["dependencies: major"] }, { "description": "Group Compose Multiplatform artifacts together",