-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
215 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: 'github-actions' | ||
directory: '/' | ||
schedule: | ||
interval: 'monthly' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: "Install dependencies" | ||
description: "Prepare repository and all dependencies" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Set up pnpm | ||
uses: pnpm/action-setup@v2 | ||
|
||
- name: Set up node | ||
uses: actions/setup-node@v3 | ||
with: | ||
cache: pnpm | ||
node-version: 18 | ||
|
||
- name: Install dependencies | ||
shell: bash | ||
run: pnpm install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Canary | ||
on: | ||
push: | ||
branches: [main] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
canary: | ||
name: Release canary | ||
permissions: write-all | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
|
||
steps: | ||
- name: Clone repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install dependencies | ||
uses: ./.github/actions/install-dependencies | ||
|
||
- name: Setup .npmrc file | ||
uses: actions/setup-node@v3 | ||
with: | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- name: Set version | ||
run: | | ||
npm --no-git-tag-version version 0.0.0 | ||
npm --no-git-tag-version version $(npm pkg get version | sed 's/"//g')-canary.$(date +'%Y%m%dT%H%M%S') | ||
pnpm bun version:update | ||
- name: Build | ||
run: pnpm build | ||
|
||
- name: Publish to npm | ||
run: npm publish --tag canary | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Changesets | ||
on: | ||
push: | ||
branches: [main] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
verify: | ||
name: Verify | ||
uses: ./.github/workflows/verify.yml | ||
secrets: inherit | ||
|
||
changesets: | ||
name: Create pull request or publish | ||
needs: verify | ||
permissions: write-all | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
|
||
steps: | ||
- name: Clone repository | ||
uses: actions/checkout@v4 | ||
with: | ||
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits | ||
fetch-depth: 0 | ||
|
||
- name: Install dependencies | ||
uses: ./.github/actions/install-dependencies | ||
|
||
- name: Create version pull request or publish to npm | ||
uses: changesets/action@v1 | ||
with: | ||
title: 'chore: version packages' | ||
commit: 'chore: version packages' | ||
createGithubReleases: ${{ github.ref == 'refs/heads/main' }} | ||
publish: pnpm changeset:publish | ||
version: pnpm changeset:version | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: Pull Request | ||
on: | ||
pull_request: | ||
types: [opened, reopened, synchronize, ready_for_review] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
verify: | ||
name: Verify | ||
uses: ./.github/workflows/verify.yml | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
name: Verify | ||
on: | ||
workflow_call: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
|
||
steps: | ||
- name: Clone repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install dependencies | ||
uses: ./.github/actions/install-dependencies | ||
|
||
- name: Lint code | ||
run: pnpm format && pnpm lint:fix | ||
|
||
- name: Update package versions | ||
run: pnpm version:update | ||
|
||
- uses: stefanzweifel/git-auto-commit-action@v4 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
commit_message: 'chore: format' | ||
commit_user_name: 'github-actions[bot]' | ||
commit_user_email: 'github-actions[bot]@users.noreply.github.com' | ||
|
||
build: | ||
name: Build | ||
needs: lint | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
|
||
steps: | ||
- name: Clone repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install dependencies | ||
uses: ./.github/actions/install-dependencies | ||
|
||
- name: Build | ||
run: pnpm build | ||
|
||
- name: Publint | ||
run: pnpm test:build | ||
|
||
- name: Check for unused files, dependencies, and exports | ||
run: pnpm knip --production --ignore-internal | ||
|
||
types: | ||
name: Types | ||
needs: lint | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
|
||
steps: | ||
- name: Clone repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install dependencies | ||
uses: ./.github/actions/install-dependencies | ||
|
||
- name: Check types | ||
run: pnpm typecheck | ||
|
||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
|
||
steps: | ||
- name: Clone repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install dependencies | ||
uses: ./.github/actions/install-dependencies | ||
|
||
- name: Run tests | ||
run: pnpm test:cov | ||
|
||
- name: Upload coverage reports to Codecov | ||
uses: codecov/codecov-action@v3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
auto-install-peers=false | ||
enable-pre-post-scripts=true | ||
provenance=true | ||
strict-peer-dependencies=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters