diff --git a/.github/labels.yml b/.github/labels.yml new file mode 100644 index 0000000..5a4051a --- /dev/null +++ b/.github/labels.yml @@ -0,0 +1,103 @@ +- name: 'Type: A11y' + description: An accessibility fixes + color: '#0000ff' +- name: 'Type: Breaking' + description: Includes backwards-incompatible fixes + color: '#b60205' +- name: 'Type: Bug' + description: Bug or Bug fixes + color: '#ee0701' +- name: 'Type: Build' + description: A packaging or a building fixes + color: '#5319e7' +- name: 'Type: Dependency' + description: Dependencies fixes + color: '#ffbce7' +- name: 'Type: Deprecated' + description: Includes deprecate fixes + color: '#f7ffa8' +- name: 'Type: Documentation' + description: A documetation fixes + color: '#5319e7' +- name: 'Type: Example' + description: Includes example and demo code fixes + color: '#db0875' +- name: 'Type: Feature' + description: Includes new features + color: '#ffff00' +- name: 'Type: I18n' + description: An internationalization fixes + color: '#ffd412' +- name: 'Type: Improvement' + description: Includes backwards-compatible fixes + color: '#1d76db' +- name: 'Type: Maintenance' + description: Repository Maintenance + color: '#e5ef7a' +- name: 'Type: Performance' + description: Includes performance fixes + color: '#cc317c' +- name: 'Type: Refactoring' + description: A code change that neither fixes a bug nor adds a feature + color: '#fbca04' +- name: 'Type: Security' + description: Security fixes + color: '#b60205' +- name: 'Type: Testing' + description: Adding missing tests or correcting existing tests + color: '#0e8a16' +- name: typescript + color: '#106FDF' +- name: workaround + color: '#026172' +- name: todo + color: '#c2e0c6' +- name: tips + color: '#fbca04' +- name: duplicate + description: This issue or Pull Request already exists + color: '#ededed' +- name: good first issue + description: Good for newcomers + color: '#7057ff' +- name: help wanted + description: Extra attention is needed + color: '#e99695' +- name: release + color: '#581fba' +- name: 'Status: Abandoned' + description: The issue or Pull Request is wontfix + color: '#000000' +- name: 'Status: Blocked' + description: Progress on the issue is Blocked + color: '#ee0701' +- name: 'Status: In Progress' + description: Work in Progress + color: '#cccccc' +- name: 'Status: Need More Info' + description: Lacks enough info to make progress + color: '#F9C90A' +- name: 'Status: PR Welcome' + description: Welcome to Pull Request + color: '#2E7733' +- name: 'Status: Proposal' + description: Request for comments + color: '#d4c5f9' +- name: 'Status: Review Needed' + description: Request for review comments + color: '#fbca04' +- name: ๐Ÿงน p1-chore + description: 'Priority 1: no change in change code behavior' + color: '#FDDFD7' +- name: ๐Ÿฐ p2-nice-to-have + description: "Priority 2: nothing is broken but it's worth addressing" + color: '#0e8a16' +- name: ๐Ÿ”จ p3-minor-bug + description: 'Priority 3: a bug in an edge case that only affects very specific usage' + color: '#fbca04' +- name: โ— p4-important + description: 'Priority 4: bugs that violate documented behavior, or significantly impact perf' + color: '#d93f0b' +- name: ๐Ÿ”ฅ p5-urgent + description: 'Priority 5: build-breaking bugs that affect most users and should be fixed ASAP' + color: '#ee0701' diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 0000000..80a8dc4 --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,58 @@ +changelog: + exclude: + labels: + - ignore-for-release + authors: + - octocat + - renovate[bot] + - dependabot[bot] + categories: + - title: ๐ŸŒŸ Features + labels: + - feature + - 'Type: Feature' + - title: ๐Ÿ› Bug Fixes + labels: + - bug + - 'Type: Bug' + - title: ๐Ÿ’ฅ Breaking Changes + labels: + - breaking + - 'Type: Breaking' + - title: โš ๏ธ Deprecated Features + labels: + - deprecated + - 'Type: Deprecated' + - title: โšก Improvement Features + labels: + - improvement + - 'Type: Improvement' + - title: ๐Ÿ”’ Security Fixes + labels: + - security + - 'Type: Security' + - title: ๐Ÿ“ˆ Performance Fixes + labels: + - performance + - 'Type: Performance' + - title: ๐Ÿ“๏ธ Documentations + labels: + - documentation + - 'Type: Documentation' + - title: ๐Ÿ‘• Refactoring + labels: + - refactoring + - 'Type: Refactoring' + - title: ๐Ÿญ Examples + labels: + - example + - 'Type: Example' + - title: ๐ŸŒ โ™ฟ Internationalization or Accessibility Fixes + labels: + - a11y + - i18n + - 'Type: I18n' + - 'Type: A11y' + - title: ๐Ÿช„ Others + labels: + - chore diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..9d6e24f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,130 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + branches: + - main +permissions: + contents: read +env: + CI: true + +jobs: + lint: + name: Lint + strategy: + matrix: + os: [ubuntu-latest] + node: [18] + + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout codes + uses: actions/checkout@v4 + + - name: Enable corepack + run: corepack enable + + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + cache: pnpm + + - name: Install dependencies + run: pnpm install --no-frozen-lockfile + + - name: Lint codes + run: pnpm lint + + build: + name: Build + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + node: [18] + + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout codes + uses: actions/checkout@v4 + + - name: Enable corepack + run: corepack enable + + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + cache: pnpm + + - name: Install dependencies + run: pnpm install --no-frozen-lockfile + + - name: Cache dist + uses: actions/cache@v4 + with: + path: packages/*/dist + key: build-vue-i18n-os-${{ matrix.os }}-${{ github.sha }} + + unittest: + name: Unit test + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + node: [18.19, 20, 22] + + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout codes + uses: actions/checkout@v4 + + - name: Enable corepack + run: corepack enable + + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + cache: pnpm + + - name: Install dependencies + run: pnpm install --no-frozen-lockfile + + - name: Run unit tests + run: | + pnpm test + + typecheck: + name: Type checking + strategy: + matrix: + os: [ubuntu-latest] + node: [18] + + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout codes + uses: actions/checkout@v4 + + - name: Enable corepack + run: corepack enable + + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + cache: pnpm + + - name: Install dependencies + run: pnpm install --no-frozen-lockfile + + - name: Run type checking + run: pnpm typecheck diff --git a/.github/workflows/github-label-sync.yml b/.github/workflows/github-label-sync.yml new file mode 100644 index 0000000..02f1dc9 --- /dev/null +++ b/.github/workflows/github-label-sync.yml @@ -0,0 +1,17 @@ +name: Label sync + +on: + push: + branches: + - master + paths: + - .github/labels.yml + - .github/workflows/github-label-sync.yml + # eslint-disable-next-line yml/no-empty-mapping-value + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: r7kamura/github-label-sync-action@v0 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..081286d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,61 @@ +name: Release + +on: + push: + branches-ignore: + - '**' + tags: + - 'v*' +env: + NODE_OPTIONS: --max-old-space-size=6144 + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout codes + uses: actions/checkout@v4 + with: + ref: ${{ github.head_ref }} + + - name: Enable corepack + run: corepack enable + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 18 + + - name: Install dependencies + run: pnpm install --no-frozen-lockfile + + - name: Extract version tag + if: startsWith( github.ref, 'refs/tags/v' ) + uses: jungwinter/split@v2 + id: split + with: + msg: ${{ github.ref }} + separator: / + + - name: Create Github Release + run: gh release create ${{ steps.split.outputs._2 }} --generate-notes + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Generate changelog + run: npx gh-changelogen --repo=inclusion-vapor --tag=${{ steps.split.outputs._2 }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Commit changelog + uses: stefanzweifel/git-auto-commit-action@v5 + with: + branch: master + file_pattern: '*.md' + commit_message: 'chore: sync changelog' + + - name: Publish package + run: | + ./scripts/release.sh + env: + NPM_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}} diff --git a/scripts/release.sh b/scripts/release.sh new file mode 100755 index 0000000..9c3a861 --- /dev/null +++ b/scripts/release.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +set -e + +# Restore all git changes +git restore -s@ -SW -- packages + +# Build +pnpm build + +# Update token +if [[ ! -z ${NPM_AUTH_TOKEN} ]] ; then + echo "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}" >> ~/.npmrc + echo "registry=https://registry.npmjs.org/" >> ~/.npmrc + echo "always-auth=true" >> ~/.npmrc + npm whoami +fi + +# Release packages +for PKG in packages/* ; do + if [[ -d $PKG ]]; then + if [[ $PKG == packages/svelte-template-explorer || $PKG == packages/jsx-explorer || $PKG == packages/playground || $PKG == pakcages/shared ]]; then + continue + fi + pushd $PKG + TAG="latest" + echo "โšก Publishing $PKG with tag $TAG" + # pnpm publish --access public --no-git-checks --tag $TAG --dry-run + popd > /dev/null + fi +done