diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5f927e5..2338026 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,41 +10,12 @@ permissions: contents: read jobs: - lint: - name: Lint - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - - name: Set up Node.js - uses: actions/setup-node@v6 - with: - node-version: 'lts/*' - cache: 'npm' - - - name: Install dependencies - run: npm ci - - - name: Check Prettier - run: npx prettier --check . - - - name: Check Commitlint (pull request) - if: github.event_name == 'pull_request' - run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose - - - name: Check Commitlint (push) - if: github.event_name == 'push' - run: npx commitlint --last --verbose - - - name: Check licenses - run: npm run check:licenses - - - name: Check types - run: npm run build - - - name: Lint - run: npm run lint + commits: + name: Commits + uses: NixySoftware/.github/.github/workflows/commits.yml@9704b92a2cefe90342562266d127a0c9dd132640 # v0.2.0 + + typescript: + name: TypeScript + uses: NixySoftware/.github/.github/workflows/typescript.yml@9704b92a2cefe90342562266d127a0c9dd132640 # v0.2.0 + with: + enable-test: false diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1b13743..e9b13d6 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -4,44 +4,17 @@ on: release: types: [published] +permissions: + contents: read + id-token: write + packages: write + jobs: publish: name: Publish - runs-on: ubuntu-latest - - permissions: - contents: read - id-token: write - packages: write - - steps: - - name: Checkout - uses: actions/checkout@v6 - - - name: Set up Node.js - uses: actions/setup-node@v6 - with: - node-version: 'lts/*' - cache: 'npm' - registry-url: 'https://registry.npmjs.org' - - - name: Install dependencies - run: npm ci - - - name: Build - run: npm run build - - - name: Publish to npm - run: npm publish --access public --registry https://registry.npmjs.org --workspaces - - - name: Set up Node.js - uses: actions/setup-node@v6 - with: - node-version: 'lts/*' - cache: 'npm' - registry-url: 'https://npm.pkg.github.com' - - - name: Publish to GitHub Packages - run: npm publish --access public --registry https://npm.pkg.github.com --workspaces - env: - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: NixySoftware/.github/.github/workflows/publish.yml@9704b92a2cefe90342562266d127a0c9dd132640 # v0.2.0 + with: + enable-rust: false + enable-typescript: true + typescript-registry-github: true + typescript-registry-npm: true diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 2e4075c..ec6c34b 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -8,13 +8,6 @@ permissions: contents: read jobs: - lint-title: - runs-on: ubuntu-latest - name: Lint title - - steps: - - name: Conventional Commits - uses: ytanikin/pr-conventional-commits@1.5.2 - with: - task_types: '["build","chore","ci","docs","feat","fix","perf","refactor","revert","style","test"]' - add_label: 'false' + pull-request: + name: Pull Request + uses: NixySoftware/.github/.github/workflows/commits.yml@9704b92a2cefe90342562266d127a0c9dd132640 # v0.2.0 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0e7e496..940f49f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,74 +14,16 @@ on: permissions: contents: write - packages: write jobs: release: name: Release - runs-on: ubuntu-latest - - steps: - - name: Generate GitHub App token - id: app-token - uses: getsentry/action-github-app-token@v3 - with: - app_id: ${{ secrets.APP_ID }} - private_key: ${{ secrets.APP_PRIVATE_KEY }} - - - name: Checkout - uses: actions/checkout@v6 - - - name: Set up Node.js - uses: actions/setup-node@v6 - with: - node-version: 'lts/*' - cache: 'npm' - - - name: Install dependencies - run: npm ci - - - name: Bump version - run: npx lerna version --no-git-tag-version --yes ${{ inputs.bump }} - - - name: Extract version - id: extract-version - run: echo "VERSION=v$(jq -r .version ./lerna.json)" >> "$GITHUB_OUTPUT" - - - name: Format with Prettier - run: npx prettier --write . - - - name: Add changes - run: git add . - - - name: Commit - id: commit - uses: dsanders11/github-app-commit-action@v2 - with: - message: ${{ steps.extract-version.outputs.VERSION }} - token: ${{ steps.app-token.outputs.token }} - - - name: Reset and pull - run: git reset --hard && git pull - - - name: Tag - uses: actions/github-script@v9 - env: - GIT_TAG: ${{ steps.extract-version.outputs.VERSION }} - GIT_SHA: ${{ steps.commit.outputs.sha }} - with: - script: | - github.rest.git.createRef({ - owner: context.repo.owner, - repo: context.repo.repo, - ref: `refs/tags/${process.env.GIT_TAG}`, - sha: process.env.GIT_SHA - }) - - - name: Release - uses: softprops/action-gh-release@v3 - with: - generate_release_notes: true - make_latest: true - tag_name: ${{ steps.extract-version.outputs.VERSION }} - token: ${{ steps.app-token.outputs.token }} + uses: NixySoftware/.github/.github/workflows/release.yml@9704b92a2cefe90342562266d127a0c9dd132640 # v0.2.0 + with: + bump: ${{ inputs.bump }} + bump-rust: false + bump-typescript: true + extract-version: 'typescript' + secrets: + app-client-id: ${{ secrets.APP_ID }} + app-private-key: ${{ secrets.APP_PRIVATE_KEY }} diff --git a/package.json b/package.json index 7d9fc1d..c0ef22e 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "scripts": { "build": "turbo build", "check:licenses": "license-checker-rseidelsohn --summary --excludePackagesStartingWith '@nixysoftware/' --onlyAllow '0BSD;Apache-2.0;BSD-2-Clause;BSD-3-Clause;BSD*;BlueOak-1.0.0;CC0-1.0;CC-BY-3.0;CC-BY-4.0;ISC;MIT;MPL-2.0;Python-2.0;Unlicense'", + "check:types": "npm run build", "dev": "turbo dev", "lint": "turbo lint", "prepare": "npm run build"