Publish #5
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
| # Publishes @aryam/fixmap-core and @aryam/fixmap to npm. | |
| # | |
| # Uses npm trusted publishing (OIDC): no npm token or one-time password is | |
| # needed once each package is linked to this repository and workflow at | |
| # https://www.npmjs.com/package/<name>/access -> Trusted Publisher | |
| # (repository: aryamthecodebreaker/FixMap, workflow: publish.yml). | |
| # | |
| # Runs when a GitHub release is published, or manually from the Actions tab. | |
| name: Publish | |
| on: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| id-token: write | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| cache: npm | |
| registry-url: https://registry.npmjs.org | |
| - run: npm ci | |
| - run: npm run ci | |
| # Skip versions that are already on npm so a manual dispatch followed by | |
| # the release-published trigger cannot fail on a republish. | |
| - name: Publish @aryam/fixmap-core | |
| run: | | |
| VERSION=$(node -p "require('./packages/core/package.json').version") | |
| if npm view "@aryam/fixmap-core@${VERSION}" version >/dev/null 2>&1; then | |
| echo "@aryam/fixmap-core@${VERSION} is already published; skipping." | |
| else | |
| npm publish -w packages/core --provenance --access public | |
| fi | |
| - name: Publish @aryam/fixmap | |
| run: | | |
| VERSION=$(node -p "require('./packages/cli/package.json').version") | |
| if npm view "@aryam/fixmap@${VERSION}" version >/dev/null 2>&1; then | |
| echo "@aryam/fixmap@${VERSION} is already published; skipping." | |
| else | |
| npm publish -w packages/cli --provenance --access public | |
| fi |