refactor: Remove manual import button and ensure HTML always uses Rip… #45
This file contains hidden or 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 | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: oven-sh/setup-bun@v1 | |
| - name: Bump version | |
| run: | | |
| VERSION=$(jq -r '.version' package.json) | |
| IFS='.' read -r MAJOR MINOR PATCH <<< "$VERSION" | |
| NEW_VERSION="$MAJOR.$MINOR.$((PATCH + 1))" | |
| jq --arg v "$NEW_VERSION" '.version = $v' package.json > package.json.tmp && mv package.json.tmp package.json | |
| echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV | |
| echo "VERSION_BUMPED=true" >> $GITHUB_ENV | |
| - name: Configure git | |
| run: | | |
| git config user.name "github-actions" | |
| git config user.email "github-actions@github.com" | |
| - name: Commit version bump | |
| run: | | |
| git add package.json | |
| git commit -m "chore: bump version to ${{ env.NEW_VERSION }}" | |
| git push | |
| - name: Setup npm credentials | |
| run: | | |
| npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }} | |
| - name: Publish to npm | |
| run: npm publish |