update use-notification hook #24
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
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| jobs: | |
| build-and-release: | |
| runs-on: ubuntu-latest | |
| permissions: "write-all" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Fetch all history for all tags and branches | |
| - name: Use Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20.x" | |
| cache: "npm" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run tests | |
| run: npm test | |
| - name: Build | |
| run: npm run build | |
| - name: Zip dist directory | |
| run: cd dist && zip -r ../duke-prompts.zip . | |
| - name: Create Release and Upload Asset | |
| id: create_release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GH_REPO: ${{ github.repository }} | |
| run: | | |
| TAG=${GITHUB_REF_NAME} | |
| gh release create $TAG 'duke-prompts.zip#Duke Prompts' --title "Release $TAG" --generate-notes | |
| - name: Bump the version in package.json with the tag | |
| run: | | |
| TAG=${GITHUB_REF_NAME} | |
| npm version $TAG --no-git-tag-version | |
| git config --local user.email "[email protected]" | |
| git config --local user.name "GitHub Action" | |
| # Checkout the main branch (or whatever your default branch is) | |
| git fetch origin main | |
| git checkout main | |
| git add package.json | |
| git commit -m "chore(release): bump version to $TAG [skip ci]" | |
| git push origin main | |
| - name: Publish to npm | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20.x" | |
| registry-url: "https://registry.npmjs.org/" | |
| - run: npm publish --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |