Skip to content

Commit 9259eec

Browse files
committed
chore: add gha release workflow
1 parent 8382930 commit 9259eec

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

.github/workflows/release.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
deploy:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Use Node.js
17+
uses: actions/setup-node@v2
18+
with:
19+
node-version: 20.11.0
20+
21+
- name: Install pnpm
22+
uses: pnpm/action-setup@v2
23+
id: pnpm-install
24+
with:
25+
version: 8.14.0
26+
run_install: false
27+
28+
- name: Configure pnpm cache
29+
id: pnpm-cache
30+
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
31+
- uses: actions/cache@v3
32+
with:
33+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
34+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
35+
restore-keys: |
36+
${{ runner.os }}-pnpm-store-
37+
38+
- name: Install deps
39+
run: pnpm install
40+
41+
- name: Configure Turbo cache
42+
uses: dtinth/setup-github-actions-caching-for-turbo@v1
43+
44+
- name: Build
45+
run: pnpm build
46+
47+
- name: Test
48+
run: pnpm test
49+
50+
- name: Create Release Pull Request or Publish to npm
51+
id: changesets
52+
uses: changesets/action@v1
53+
with:
54+
title: "chore: bump package versions"
55+
version: pnpm changeset version
56+
publish: pnpm changeset publish
57+
commit: "chore: bump package version [skip ci]"
58+
env:
59+
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}
60+
NPM_TOKEN: ${{ env.NPM_TOKEN }}

0 commit comments

Comments
 (0)