Skip to content

Commit 602d5fa

Browse files
committed
chore: configure ci/cd
1 parent 12b61ae commit 602d5fa

File tree

10 files changed

+200
-140
lines changed

10 files changed

+200
-140
lines changed

.changeset/config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "restricted",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
11+
}

.github/workflows/cd-packages.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Publish packages
2+
3+
on:
4+
pull_request:
5+
types:
6+
- closed
7+
branches:
8+
- main
9+
10+
jobs:
11+
publish-packages:
12+
if: github.event.pull_request.merged == true && github.head_ref == 'changeset-release/main'
13+
name: Publish packages
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
with:
19+
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
20+
fetch-depth: 0
21+
22+
- name: Setup pnpm
23+
uses: pnpm/action-setup@v4
24+
25+
- name: Setup Node
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: 22
29+
registry-url: https://registry.npmjs.org
30+
cache: pnpm
31+
32+
- name: Install dependencies
33+
run: pnpm install --frozen-lockfile
34+
35+
- name: Publish
36+
uses: changesets/action@v1
37+
id: changesets
38+
with:
39+
version: pnpm version
40+
publish: pnpm tag
41+
env:
42+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
43+
outputs:
44+
ref: ${{ github.ref }}
45+
published: ${{ steps.changesets.outputs.published }}
46+
47+
deliver-packages:
48+
name: Deliver packages
49+
uses: ./.github/workflows/cd-registries.yaml
50+
needs: publish-packages
51+
with:
52+
ref: ${{ needs.publish-packages.outputs.ref }}
53+
secrets: inherit
54+
if: ${{ needs.publish-packages.outputs.published }}

.github/workflows/cd-registries.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Deploy to registries
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
ref:
7+
required: true
8+
type: string
9+
10+
jobs:
11+
build-and-deploy:
12+
name: Build and deploy packages
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout repo
16+
uses: actions/checkout@v4
17+
with:
18+
ref: ${{ inputs.ref }}
19+
20+
- name: Setup pnpm
21+
uses: pnpm/action-setup@v4
22+
23+
- name: Setup Node
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: 22
27+
registry-url: https://registry.npmjs.org
28+
cache: pnpm
29+
30+
- name: Install dependencies
31+
run: pnpm install --frozen-lockfile
32+
33+
- name: Prepare packages
34+
run: pnpm prepublish
35+
36+
- name: Publish packages on NPM
37+
run: pnpm publish -r --no-git-checks
38+
env:
39+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

.github/workflows/cd-storybook.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/check-size.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/workflows/ci-checks.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Check
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- reopened
8+
- synchronize
9+
branches:
10+
- main
11+
12+
jobs:
13+
version:
14+
name: Check
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Setup pnpm
21+
uses: pnpm/action-setup@v4
22+
23+
- name: Setup Node
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: 22
27+
registry-url: https://registry.npmjs.org
28+
cache: pnpm
29+
30+
- name: Install dependencies
31+
run: pnpm install --frozen-lockfile
32+
33+
- name: Build
34+
run: pnpm build
35+
36+
- name: Lint
37+
run: pnpm lint
38+
39+
- name: Test
40+
run: pnpm test
41+
42+
- name: Submit coverage
43+
uses: codecov/codecov-action@v4
44+
env:
45+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/ci-version.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Version packages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
version-packages:
10+
name: Version packages
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Setup pnpm
17+
uses: pnpm/action-setup@v4
18+
19+
- name: Setup Node
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: 22
23+
registry-url: https://registry.npmjs.org
24+
cache: pnpm
25+
26+
- name: Install dependencies
27+
run: pnpm install --frozen-lockfile
28+
29+
- name: Create Release Pull Request
30+
uses: changesets/action@v1
31+
id: changesets
32+
with:
33+
commit: "chore: publish new release"
34+
title: "chore: publish new release"
35+
env:
36+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
37+
38+
- name: Get current branch
39+
id: get_branch
40+
run: echo "CURRENT_BRANCH=$(git branch --show-current)" >> $GITHUB_ENV
41+
42+
- name: Update lock file
43+
if: env.CURRENT_BRANCH == 'changeset-release/main'
44+
run: pnpm install --lockfile-only
45+
46+
- name: Commit lock file
47+
if: env.CURRENT_BRANCH == 'changeset-release/main'
48+
uses: stefanzweifel/git-auto-commit-action@v5
49+
with:
50+
commit_message: "chore: update lock file"
51+
branch: changeset-release/main

.github/workflows/ci.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

.github/workflows/release-management.yml

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)