2.6.0 #25
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 Package | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Setup node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "18.x" | |
| cache: "npm" | |
| registry-url: https://registry.npmjs.org/ | |
| - name: Configure git | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run test | |
| run: npm run test | |
| - name: Build | |
| run: npm run build | |
| - name: Publish | |
| run: npm publish | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - name: Get package version | |
| id: package-version | |
| run: echo "version=$(jq -r .version package.json)" >> $GITHUB_OUTPUT | |
| - name: Create release | |
| uses: actions/crete-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: v${{ steps.package-version.outputs.version }} | |
| release_name: Release v${{ steps.package-version.outputs.version }} | |
| draft: false | |
| prerelease: false |