-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (31 loc) · 919 Bytes
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: CI
on: [push]
jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: pnpm/action-setup@v4
with:
version: 8
- uses: actions/checkout@v4
with:
fetch-depth: 2
- run: pnpm install
- run: pnpm test
- run: pnpm lint
- run: pnpm format:check
- run: pnpm build
- run: |
if [ $GITHUB_REF != "refs/heads/main" ]; then
echo "Branch is not main, skipping publish step."
exit 0
fi
echo "Branch is main"
prev_version=$(git show HEAD~1:package.json | jq -r '.version')
new_version=$(cat package.json | jq -r '.version')
if [ $prev_version = $new_version ]; then
echo "Version has not changed, skipping publish step."
exit 0
fi
echo "Version was changed, proceeding with publish step."
pnpm publish