From a197b6d8bc1d23ac7b9bf77155ba6f2377f041e3 Mon Sep 17 00:00:00 2001 From: James Ives Date: Fri, 5 Jul 2024 12:18:40 -0400 Subject: [PATCH] feat: :sparkles: standardize community features --- .github/FUNDING.yml | 2 - .github/ISSUE_TEMPLATE/BUG.yml | 50 ++++++++++++++ .github/ISSUE_TEMPLATE/BUG_REPORT.md | 28 -------- .github/release.yml | 37 +++++++++++ .github/workflows/build.yml | 2 +- .github/workflows/codeql-analysis.yml | 31 --------- .github/workflows/integration.yml | 2 +- .github/workflows/label.yml | 95 +++++++++++++++++++++++++++ .github/workflows/production.yml | 3 +- .github/workflows/publish.yml | 57 ---------------- .github/workflows/sponsors.yml | 3 +- .github/workflows/version.yml | 57 +++++++++++++++- 12 files changed, 244 insertions(+), 123 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/BUG.yml delete mode 100644 .github/ISSUE_TEMPLATE/BUG_REPORT.md create mode 100644 .github/release.yml delete mode 100644 .github/workflows/codeql-analysis.yml create mode 100644 .github/workflows/label.yml delete mode 100644 .github/workflows/publish.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 077f6c801..a0ccaeeec 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,3 +1 @@ -# These are supported funding model platforms - github: [JamesIves] diff --git a/.github/ISSUE_TEMPLATE/BUG.yml b/.github/ISSUE_TEMPLATE/BUG.yml new file mode 100644 index 000000000..a59e77ef5 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/BUG.yml @@ -0,0 +1,50 @@ +name: Bug Report ๐Ÿ +description: Create a bug report to help us improve the action. +title: 'bug: ๐Ÿ ' +labels: ['bug ๐Ÿ', 'triage โš ๏ธ'] +assignees: + - JamesIves +body: + - type: markdown + attributes: + value: | + Thank you for taking the time to report a bug. Please fill out the sections below to help us reproduce the issue and improve the action. If you're unsure about something, feel free to skip it or write N/A in the field. + + [Please check the Q&A before posting an issue here](https://github.com/JamesIves/github-sponsors-readme-action/discussions/categories/q-a). + - type: textarea + id: bug-description + attributes: + label: Describe the bug + description: 'Please provide a clear and concise description of what the bug is and what you expected to happen.' + validations: + required: true + - type: textarea + id: reproduction-steps + attributes: + label: Reproduction Steps + description: 'Steps to reproduce the behavior. Please provide a minimal example if possible.' + validations: + required: true + - type: textarea + id: logs + attributes: + label: Logs + description: "Please provide your deployment logs if applicable. If the error message isn't revealing the problem please set ACTIONS_STEP_DEBUG to true in your repository's secrets menu and run the workflow again." + render: shell + validations: + required: false + - type: textarea + id: workflow + attributes: + label: Workflow + description: 'Please provide a link or snippet of your workflow yml file.' + render: yml + validations: + required: true + - type: textarea + id: additional-comments + attributes: + label: Additional Comments + description: 'Add any other context about the problem here that does not fit elsewhere.' + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/BUG_REPORT.md b/.github/ISSUE_TEMPLATE/BUG_REPORT.md deleted file mode 100644 index 0599b01a0..000000000 --- a/.github/ISSUE_TEMPLATE/BUG_REPORT.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -name: Bug Report -about: Create a bug report to help us improve the action. -labels: - - triage โš ๏ธ ---- - - - -## Describe the bug - - - -## Reproduction Steps - - - -## Logs - - - -## Workflow - - - -## Additional Comments - - diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 000000000..7c8c562a6 --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,37 @@ +changelog: + categories: + - title: Breaking Changes ๐Ÿ’ฅ + labels: + - breaking ๐Ÿ’ฅ + - breaking + - title: New Features ๐ŸŽ‰ + labels: + - feature โœจ + - feat + - title: Bug Fixes ๐Ÿ + labels: + - fix ๐Ÿ + - bug ๐Ÿ + - fix + - title: Performance โšก + labels: + - performance โšก + - perf + - title: Build ๐Ÿ”ง + labels: + - build ๐Ÿ”ง + - build + - title: Testing ๐Ÿงช + labels: + - test ๐Ÿงช + - test + - title: Documentation ๐Ÿ“– + labels: + - documentation ๐Ÿ“– + - docs + - title: Dependencies ๐Ÿค– + labels: + - dependencies + - title: Other Changes + labels: + - '*' diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f30a6ab3f..645a325d6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: unit-tests +name: Unit Tests ๐Ÿงช on: pull_request: branches: diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 83d9d8f08..000000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: 'CodeQL' -on: - push: - branches: - - dev - - 'dev-v*' - - 'releases/v*' - pull_request: - branches: - - dev - - 'dev-v*' - schedule: - - cron: '0 9 * * 4' - -jobs: - analyse: - name: Analyse - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - - - name: Autobuild - uses: github/codeql-action/autobuild@v3 - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 5b4b31b8d..074051cda 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -1,4 +1,4 @@ -name: integration-tests +name: Integration Tests ๐Ÿงช on: workflow_dispatch: inputs: diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml new file mode 100644 index 000000000..e6cde3ee3 --- /dev/null +++ b/.github/workflows/label.yml @@ -0,0 +1,95 @@ +name: Label Pull Requests ๐Ÿท๏ธ + +on: + pull_request: + types: [opened, reopened, labeled, unlabeled] + +permissions: + pull-requests: write + contents: read + +jobs: + assign-labels: + runs-on: ubuntu-latest + name: Assign labels in pull request ๐Ÿท๏ธ + if: github.event.pull_request.merged == false + steps: + - name: Checkout ๐Ÿ›Ž๏ธ + uses: actions/checkout@v3 + + - name: Assign Labels ๐Ÿท๏ธ + id: action-assign-labels + uses: mauroalderete/action-assign-labels@v1 + with: + pull-request-number: ${{ github.event.pull_request.number }} + github-token: ${{ secrets.GITHUB_TOKEN }} + conventional-commits: | + conventional-commits: + - type: 'fix' + nouns: ['FIX', 'Fix', 'fix', 'FIXED', 'Fixed', 'fixed'] + labels: ['bug ๐Ÿ', 'fix ๐Ÿ'] + - type: 'feature' + nouns: ['FEATURE', 'Feature', 'feature', 'FEAT', 'Feat', 'feat'] + labels: ['feature โœจ'] + - type: 'breaking_change' + nouns: ['BREAKING CHANGE', 'BREAKING', 'MAJOR'] + labels: ['breaking ๐Ÿ’ฅ'] + - type: 'documentation' + nouns: ['doc', 'docu', 'document', 'documentation'] + labels: ['documentation ๐Ÿ“–'] + - type: 'build' + nouns: ['build', 'rebuild'] + labels: ['build ๐Ÿ”ง'] + - type: 'chore' + nouns: ['chore', 'tidy', 'cleanup'] + labels: ['chore ๐Ÿงน'] + - type: 'dependencies' + nouns: ['dependency', 'dependencies', 'package', 'packages', 'bump', 'dependabot'] + labels: ['dependencies ๐Ÿค–'] + - type: 'duplicate' + nouns: ['duplicate', 'dupe', 'copy'] + labels: ['duplicate 2๏ธโƒฃ'] + - type: 'good_first_issue' + nouns: ['good first issue', 'beginner', 'newcomer', 'first-timer'] + labels: ['good first issue ๐Ÿฉ'] + - type: 'help_wanted' + nouns: ['help wanted', 'need help', 'assistance required'] + labels: ['help wanted โ•'] + - type: 'proposal' + nouns: ['proposal', 'suggest', 'suggestion'] + labels: ['proposal ๐Ÿ”ฎ'] + - type: 'question' + nouns: ['question', 'inquiry', 'query'] + labels: ['question โ“'] + - type: 'test' + nouns: ['test', 'testing', 'tests'] + labels: ['test ๐Ÿงช'] + - type: 'triage' + nouns: ['triage', 'sort', 'prioritize'] + labels: ['triage โš ๏ธ'] + - type: 'wontfix' + nouns: ['wontfix', 'will not fix', 'not fixing'] + labels: ['wontfix ๐Ÿ”จ'] + - type: 'style' + nouns: ['style', 'formatting', 'format'] + labels: ['style ๐ŸŽ€'] + - type: 'security' + nouns: ['security', 'secure', 'safety'] + labels: ['security ๐Ÿ”’'] + - type: 'performance' + nouns: ['performance', 'speed', 'optimization'] + labels: ['performance ๐Ÿš€'] + - type: 'refactor' + nouns: ['refactor', 'refactoring', 'rework'] + labels: ['refactor ๐Ÿ› '] + - type: 'release' + nouns: ['release', 'deploy', 'deployment'] + labels: ['release ๐Ÿš€'] + - type: 'ci' + nouns: ['ci', 'continuous integration', 'CI/CD'] + labels: ['ci ๐Ÿš€'] + - type: 'hacktoberfest' + nouns: ['hacktoberfest', 'october', 'open source'] + labels: ['hacktoberfest ๐ŸŽƒ'] + maintain-labels-not-matched: false + apply-changes: true diff --git a/.github/workflows/production.yml b/.github/workflows/production.yml index 7ad54d997..eaf83567b 100644 --- a/.github/workflows/production.yml +++ b/.github/workflows/production.yml @@ -1,4 +1,5 @@ -name: Deploy Production Dependencies and Code +name: Deploy Production Dependencies and Code ๐Ÿš€ + on: workflow_dispatch: push: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 4f69a8286..000000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: publish-to-npm -on: - workflow_dispatch: - inputs: - version: - description: 'The updated registry version number.' - required: true - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - ref: dev - - # Setup .npmrc file to publish to npm - - uses: actions/setup-node@v4 - with: - node-version-file: '.nvmrc' - registry-url: 'https://registry.npmjs.org' - scope: '@jamesives' - - - name: Configure Git - run: | - git config user.email "iam@jamesiv.es" - git config user.name "James Ives" - - - name: Install Yarn - run: npm install -g yarn - - - run: yarn install --frozen-lockfile - - run: yarn build - - run: npm version ${{ github.event.inputs.version }} -m "Release ${{ github.event.inputs.version }} ๐Ÿ“ฃ" - - run: git push - - # Publish to npm - - run: npm publish --access public - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - # Setup .npmrc file to publish to GitHub Packages - - uses: actions/setup-node@v4 - with: - node-version-file: '.nvmrc' - registry-url: 'https://npm.pkg.github.com' - scope: '@jamesives' - - - name: Authenticate with the GitHub Package Registry - run: - echo "//npm.pkg.github.com:_authToken=${{ secrets.GITHUB_TOKEN }}" > - ~/.npmrc - - # Publish to GitHub Packages - - run: npm publish - env: - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/sponsors.yml b/.github/workflows/sponsors.yml index 80a629f8b..00c74b937 100644 --- a/.github/workflows/sponsors.yml +++ b/.github/workflows/sponsors.yml @@ -1,4 +1,5 @@ -name: publish-sponsors +name: Publish Sponsors to README ๐Ÿ“ฃ + on: workflow_dispatch: schedule: diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml index 47c18a7d1..3586e735e 100644 --- a/.github/workflows/version.yml +++ b/.github/workflows/version.yml @@ -1,4 +1,4 @@ -name: Update Major Version Tag +name: Update Major Version Tag and Publish to Registry ๐Ÿ“ฆ on: push: @@ -11,3 +11,58 @@ jobs: runs-on: ubuntu-latest steps: - uses: nowactions/update-majorver@v1.1.2 + + update-registries: + name: Publish to Registries ๐Ÿ“ฆ + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: dev + + # Setup .npmrc file to publish to npm + - uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + registry-url: 'https://registry.npmjs.org' + scope: '@jamesives' + + - name: Configure Git + run: | + git config user.email "iam@jamesiv.es" + git config user.name "James Ives" + + - name: Install Yarn + run: npm install -g yarn + + - run: yarn install --frozen-lockfile + - run: yarn build + - run: git stash + - name: Set version to match the tag + run: | + VERSION=${GITHUB_REF#refs/tags/v} + npm version $VERSION -m "Release $VERSION ๐Ÿ“ฃ" + env: + GITHUB_REF: ${{ github.ref }} + - run: git push + + # Publish to npm + - run: npm publish --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + + # Setup .npmrc file to publish to GitHub Packages + - uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + registry-url: 'https://npm.pkg.github.com' + scope: '@jamesives' + + - name: Authenticate with the GitHub Package Registry + run: | + echo "//npm.pkg.github.com:_authToken=${{ secrets.GITHUB_TOKEN }}" > ~/.npmrc + + # Publish to GitHub Packages + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}