Release v0.1.8 and skip republish of existing package versions. #5
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: Publish to GitHub Packages | |
| on: | |
| push: | |
| tags: ["v*"] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| packages: write | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| registry-url: https://npm.pkg.github.com | |
| scope: "@coderic" | |
| - run: npm install | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - run: npm test --if-present | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - run: npm run build | |
| - name: Publish package | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| VERSION="$(node -p "require('./package.json').version")" | |
| if npm view "@coderic/dashboard-shell@${VERSION}" version --registry=https://npm.pkg.github.com >/dev/null 2>&1; then | |
| echo "Version ${VERSION} already published; skipping npm publish." | |
| exit 0 | |
| fi | |
| npm publish --access public |