Test publish step #8
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
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 |