2.0.5 #7
Workflow file for this run
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
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| name: Create Release | |
| jobs: | |
| lint-and-tests: | |
| name: Run linter and tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout source | |
| uses: actions/checkout@v3 | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run linter | |
| run: npm run lint | |
| - name: Run tests | |
| run: npm run test -- --ci | |
| publish-to-npm: | |
| name: Publish to npm | |
| runs-on: ubuntu-latest | |
| needs: lint-and-tests | |
| steps: | |
| - name: Checkout source | |
| uses: actions/checkout@v3 | |
| with: | |
| token: ${{ secrets.PUBLISH_TOKEN }} | |
| - name: Setup node | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 18 | |
| registry-url: https://registry.npmjs.org | |
| token: ${{ secrets.NPM_PUBLISH_TOKEN }} | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: build | |
| run: npm run build | |
| - name: Publish package | |
| run: npm publish | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} | |
| create-github-release: | |
| name: Create GitHub Release | |
| runs-on: ubuntu-latest | |
| needs: publish-to-npm | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Create Release | |
| run: gh release create ${{ github.ref }} --generate-notes | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.PUBLISH_TOKEN }} |