@seamless-auth/core v0.4.5 #42
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 | |
| jobs: | |
| publish: | |
| name: Publish Package | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| registry-url: https://registry.npmjs.org/ | |
| - name: Determine package and version | |
| id: meta | |
| run: | | |
| TAG="${{ github.event.release.tag_name }}" | |
| if [[ "$TAG" == core-v* ]]; then | |
| PACKAGE="core" | |
| VERSION="${TAG#core-v}" | |
| elif [[ "$TAG" == express-v* ]]; then | |
| PACKAGE="express" | |
| VERSION="${TAG#express-v}" | |
| else | |
| echo "Invalid tag format" | |
| exit 1 | |
| fi | |
| echo "package=$PACKAGE" >> $GITHUB_OUTPUT | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "Publishing $PACKAGE version $VERSION" | |
| - name: Validate package.json version matches tag | |
| working-directory: packages/${{ steps.meta.outputs.package }} | |
| run: | | |
| PACKAGE_VERSION=$(node -p "require('./package.json').version") | |
| if [ "$PACKAGE_VERSION" != "${{ steps.meta.outputs.version }}" ]; then | |
| echo "Version mismatch!" | |
| echo "Tag version: ${{ steps.meta.outputs.version }}" | |
| echo "package.json version: $PACKAGE_VERSION" | |
| exit 1 | |
| fi | |
| - name: Validate express core dependency | |
| if: steps.meta.outputs.package == 'express' | |
| working-directory: packages/express | |
| run: | | |
| CORE_RANGE=$(node -p "require('./package.json').dependencies['@seamless-auth/core']") | |
| CORE_VERSION=$(node -p "require('../core/package.json').version") | |
| EXPECTED="^${CORE_VERSION}" | |
| if [ "$CORE_RANGE" != "$EXPECTED" ]; then | |
| echo "Express must depend on @seamless-auth/core ${EXPECTED}, found ${CORE_RANGE}" | |
| exit 1 | |
| fi | |
| - name: Install dependencies | |
| run: | | |
| if [ "${{ steps.meta.outputs.package }}" = "express" ]; then | |
| npm --prefix packages/core ci | |
| npm --prefix packages/express ci | |
| else | |
| npm --prefix packages/core ci | |
| fi | |
| - name: Test package | |
| run: | | |
| if [ "${{ steps.meta.outputs.package }}" = "express" ]; then | |
| npm --prefix packages/express test | |
| else | |
| npm --prefix packages/core test | |
| fi | |
| - name: Publish to npm | |
| working-directory: packages/${{ steps.meta.outputs.package }} | |
| run: npm publish --access public --provenance | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |