fix: set isDirty when setValues is called #27
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: Publish to npm | |
on: | |
push: | |
branches: | |
- main | |
- beta | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
registry-url: 'https://registry.npmjs.org/' | |
- name: Install dependencies | |
run: npm install | |
- name: Run typecheck | |
run: npm run typecheck | |
- name: Run linter | |
run: npm run lint | |
- name: Run tests | |
run: npm test | |
- name: Check if version has been bumped | |
id: version-check | |
run: | | |
VERSION=$(node -p "require('./package.json').version") | |
NPM_VERSION=$(npm view $(node -p "require('./package.json').name") version) | |
if [ "$VERSION" = "$NPM_VERSION" ]; then | |
echo "Version has not been bumped." | |
echo "bumped=false" >> $GITHUB_OUTPUT | |
else | |
echo "Version has been bumped." | |
echo "bumped=true" >> $GITHUB_OUTPUT | |
fi | |
- name: Build | |
if: steps.version-check.outputs.bumped == 'true' | |
run: npm run build | |
- name: Publish to npm | |
if: steps.version-check.outputs.bumped == 'true' | |
run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |