diff --git a/.github/issue-labeler.yml b/.github/issue-labeler.yml new file mode 100644 index 0000000..6a8968e --- /dev/null +++ b/.github/issue-labeler.yml @@ -0,0 +1,51 @@ +packages:asset-manager: + - "### Which (package|utils|package or utils) is this (bug + report|feature request) for\\?\\n\\nasset-manager\\n" + +packages:common: + - "### Which (package|utils|package or utils) is this (bug + report|feature request) for\\?\\n\\ncommon\\n" + +packages:config: + - "### Which (package|utils|package or utils) is this (bug + report|feature request) for\\?\\n\\nconfig\\n" + +packages:core: + - "### Which (package|utils|package or utils) is this (bug + report|feature request) for\\?\\n\\ncore\\n" + +packages:ecs-client: + - "### Which (package|utils|package or utils) is this (bug + report|feature request) for\\?\\n\\necs-client\\n" + +packages:ecs-lib: + - "### Which (package|utils|package or utils) is this (bug + report|feature request) for\\?\\n\\necs-lib\\n" + +packages:ecs-server: + - "### Which (package|utils|package or utils) is this (bug + report|feature request) for\\?\\n\\necs-server\\n" + +packages:graphics-2d: + - "### Which (package|utils|package or utils) is this (bug + report|feature request) for\\?\\n\\ngraphics-2d\\n" + +packages:input: + - "### Which (package|utils|package or utils) is this (bug + report|feature request) for\\?\\n\\ninput\\n" + +packages:music: + - "### Which (package|utils|package or utils) is this (bug + report|feature request) for\\?\\n\\nmusic\\n" + +packages:sound: + - "### Which (package|utils|package or utils) is this (bug + report|feature request) for\\?\\n\\nsound\\n" + +utils:eslint-config: + - "### Which (package|utils|package or utils) is this (bug + report|feature request) for\\?\\n\\nstructures\\n" + +utils:prettier-config: + - "### Which (package|utils|package or utils) is this (bug + report|feature request) for\\?\\n\\ui\\n" diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 0000000..8da8aec --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,77 @@ +packages:asset-manager: + - changed-files: + - any-glob-to-any-file: + - packages/asset-manager/* + - packages/asset-manager/**/* + +packages:common: + - changed-files: + - any-glob-to-any-file: + - packages/common/* + - packages/common/**/* + +packages:config: + - changed-files: + - any-glob-to-any-file: + - packages/config/* + - packages/config/**/* + +packages:core: + - changed-files: + - any-glob-to-any-file: + - packages/core/* + - packages/core/**/* + +packages:ecs-client: + - changed-files: + - any-glob-to-any-file: + - packages/ecs-client/* + - packages/ecs-client/**/* + +packages:ecs-lib: + - changed-files: + - any-glob-to-any-file: + - packages/ecs-lib/* + - packages/ecs-lib/**/* + +packages:ecs-server: + - changed-files: + - any-glob-to-any-file: + - packages/ecs-server/* + - packages/ecs-server/**/* + +packages:graphics-2d: + - changed-files: + - any-glob-to-any-file: + - packages/graphics-2d/* + - packages/graphics-2d/**/* + +packages:input: + - changed-files: + - any-glob-to-any-file: + - packages/input/* + - packages/input/**/* + +packages:music: + - changed-files: + - any-glob-to-any-file: + - packages/music/* + - packages/music/**/* + +packages:sound: + - changed-files: + - any-glob-to-any-file: + - packages/sound/* + - packages/sound/**/* + +utils:eslint-config: + - changed-files: + - any-glob-to-any-file: + - utils/eslint-config/* + - utils/eslint-config/**/* + +utils:prettier-config: + - changed-files: + - any-glob-to-any-file: + - utils/prettier-config/* + - utils/prettier-config/**/* diff --git a/.github/labels.yml b/.github/labels.yml new file mode 100644 index 0000000..01a9fe5 --- /dev/null +++ b/.github/labels.yml @@ -0,0 +1,107 @@ +- name: "blocked" + description: "This is blocked" + color: "e92f1d" + +- name: "bug" + description: "Something isn't working" + color: "d73a4a" + +- name: "chore" + description: "Changes that don't affect the codebase (eg. CI, docs)" + color: "eba8cc" + +- name: "ci" + description: "Changes to our CI configuration files and scripts" + color: "721cdb" + +- name: "documentation" + description: "Improvements or additions to documentation" + color: "0075ca" + +- name: "duplicate" + description: "This issue or pull request already exists" + color: "cfd3d7" + +- name: "enhancement" + description: "New feature or request" + color: "a2eeef" + +- name: "good first issue" + description: "Good for newcomers" + color: "7057ff" + +- name: "help wanted" + description: "Extra attention is needed" + color: "008672" + +- name: "invalid" + description: "This doesn't seem right" + color: "e4e669" + +- name: "packages:asset-manager" + description: "Related to AssetManager library" + color: "aaa3dc" + +- name: "packages:common" + description: "Related to Common library" + color: "aaa3dc" + +- name: "packages:config" + description: "Related to Config library" + color: "aaa3dc" + +- name: "packages:core" + description: "Related to Core library" + color: "aaa3dc" + +- name: "packages:ecs-client" + description: "Related to ECSClient library" + color: "aaa3dc" + +- name: "packages:ecs-lib" + description: "Related to Abstract ECS library" + color: "aaa3dc" + +- name: "packages:ecs-server" + description: "Related to ECSServer library" + color: "aaa3dc" + +- name: "packages:graphics-2d" + description: "Related to Graphics2D library" + color: "aaa3dc" + +- name: "packages:input" + description: "Related to Input library" + color: "aaa3dc" + +- name: "packages:music" + description: "Related to Music library" + color: "aaa3dc" + +- name: "packages:sound" + description: "Related to Sound library" + color: "aaa3dc" + +- name: "question" + description: "Further information is requested" + color: "d876e3" + +- name: "refactor" + description: "Code change that neither fixes a bug nor adds a feature" + color: "a3f2e8" + +- name: "tests" + description: "Adding missing tests or correcting existing tests" + color: "7f8f92" + +- name: "utils:eslint-config" + description: "Related to ESLint config" + color: "606bdf" + +- name: "utils:prettier-config" + description: "Related to Prettier config" + color: "606bdf" + +- name: "wontfix" + description: "This will not be worked on" + color: "ffffff" diff --git a/.github/workflows/issue-triage.yml b/.github/workflows/issue-triage.yml new file mode 100644 index 0000000..8d89d4a --- /dev/null +++ b/.github/workflows/issue-triage.yml @@ -0,0 +1,13 @@ +name: "Issue Labeler" +on: + issues: + types: [opened] +jobs: + issue-triage: + runs-on: ubuntu-latest + steps: + - uses: github/issue-labeler@v3.4 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" + configuration-path: .github/issue-labeler.yml + enable-versioned-regex: 0 diff --git a/.github/workflows/label-sync.yml b/.github/workflows/label-sync.yml new file mode 100644 index 0000000..33de6f1 --- /dev/null +++ b/.github/workflows/label-sync.yml @@ -0,0 +1,23 @@ +name: "Label sync" +on: + schedule: + - cron: "0 0 * * *" + workflow_dispatch: + push: + branches: + - main + paths: + - ".github/labels.yml" +jobs: + label-sync: + name: Label sync + runs-on: ubuntu-latest + if: github.repository_owner == 'discordjs' + steps: + - name: Checkout repository + uses: actions/checkout@v5 + + - name: Label sync + uses: crazy-max/ghaction-github-labeler@v5 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/pr-triage.yml b/.github/workflows/pr-triage.yml new file mode 100644 index 0000000..7e815c4 --- /dev/null +++ b/.github/workflows/pr-triage.yml @@ -0,0 +1,34 @@ +name: "PR Triage" +on: + pull_request_target: + types: + - opened + - edited + - reopened + - synchronize +jobs: + label: + name: Label + if: github.event.action != 'edited' + runs-on: ubuntu-latest + steps: + - name: Label pull request + uses: actions/labeler@v5 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" + sync-labels: true + validate-title: + name: Validate title + runs-on: ubuntu-latest + steps: + - name: Validate pull request title + env: + TITLE: ${{ github.event.pull_request.title }} + run: | + REGEX="^(revert: )?(feat|fix|docs|style|refactor|perf|test|build|ci|chore|types)(\\(.+\\))?!?: .{1,72}$" + + echo "Title: \"$TITLE\"" + + if [[ ! "$TITLE" =~ $REGEX ]]; then + exit 1 + fi