Skip to content

Test publish step

Test publish step #8

Workflow file for this run

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