issue-37 implement and describe general use-viewport hook #28
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 experimental package | |
| on: | |
| pull_request: | |
| types: [opened, synchronize] | |
| jobs: | |
| publish-experimental: | |
| runs-on: ubuntu-latest | |
| if: | | |
| github.event.pull_request.head.repo.full_name == github.repository && | |
| ${{ github.head_ref != 'main' && !startsWith(github.head_ref, 'canary') }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: "24" | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Build package | |
| run: | | |
| pnpm package run build | |
| cp README.md ./package | |
| cp LICENSE ./package | |
| - name: Build modules | |
| run: | | |
| for module in modules/*/; do | |
| echo "Building module: $module" | |
| cd "$module" | |
| pnpm run build | |
| cd - > /dev/null | |
| done | |
| - name: Run tests | |
| run: | | |
| pnpm --filter contection-tests test | |
| pnpm --filter contection-tests test:types | |
| - name: Compute experimental version | |
| id: version | |
| run: | | |
| HASH=$(git rev-parse --short HEAD) | |
| echo "version=0.0.0-experimental-${HASH}" >> $GITHUB_OUTPUT | |
| - name: Check if version already published | |
| id: check | |
| run: | | |
| VERSION=${{ steps.version.outputs.version }} | |
| EXISTS=$(npm view contection@$VERSION version 2>/dev/null || true) | |
| if [ -z "$EXISTS" ]; then | |
| echo "publish=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "publish=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Publish experimental main package | |
| if: steps.check.outputs.publish == 'true' | |
| env: | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| run: | | |
| npm set //registry.npmjs.org/:_authToken=$NPM_TOKEN | |
| VERSION=${{ steps.version.outputs.version }} | |
| npm version --no-git-tag-version $VERSION | |
| npm publish --tag experimental --access public | |
| working-directory: ./package | |
| - name: Publish experimental modules | |
| if: steps.check.outputs.publish == 'true' | |
| env: | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| run: | | |
| npm set //registry.npmjs.org/:_authToken=$NPM_TOKEN | |
| VERSION=${{ steps.version.outputs.version }} | |
| for module in modules/*/; do | |
| echo "Publishing module: $module" | |
| cd "$module" | |
| npm version --no-git-tag-version $VERSION | |
| npm publish --tag experimental --access public | |
| cd - > /dev/null | |
| done |