v0.2.1 #1
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: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| id-token: write # required for npm trusted publishing (OIDC) | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: npm | |
| url: https://www.npmjs.com/package/@mirasoth/soothe-client | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "24" | |
| registry-url: "https://registry.npmjs.org" | |
| package-manager-cache: false | |
| # Trusted publishing requires npm CLI >= 11.5.1 | |
| - name: Upgrade npm | |
| run: npm install -g npm@latest | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Get version | |
| id: version | |
| run: | | |
| VERSION=$(node -p "require('./package.json').version") | |
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | |
| echo "Package version: $VERSION" | |
| - name: Check if version exists on npm | |
| id: check | |
| run: | | |
| VERSION="${{ steps.version.outputs.version }}" | |
| PKG="@mirasoth/soothe-client" | |
| echo "Checking if ${PKG}@${VERSION} exists on npm..." | |
| if npm view "${PKG}@${VERSION}" version >/dev/null 2>&1; then | |
| echo "exists=true" >> "$GITHUB_OUTPUT" | |
| echo "Version ${VERSION} already exists on npm, skipping publish" | |
| else | |
| echo "exists=false" >> "$GITHUB_OUTPUT" | |
| echo "Version ${VERSION} not found on npm, will publish" | |
| fi | |
| - name: Verify | |
| if: steps.check.outputs.exists == 'false' | |
| run: make verify | |
| - name: Publish to npm | |
| if: steps.check.outputs.exists == 'false' | |
| run: npm publish --access public |