Nightly Build #30
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: Nightly Build | |
| on: | |
| schedule: | |
| - cron: '0 6 * * *' | |
| workflow_dispatch: {} | |
| permissions: | |
| contents: read | |
| jobs: | |
| nightly: | |
| runs-on: ubuntu-latest | |
| env: | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| ref: refs/heads/main | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Generate runtime adapters | |
| run: node scripts/generate.js | |
| - name: Check adapter drift | |
| run: | | |
| if ! git diff --exit-code --name-only; then | |
| echo "::error::Nightly drift detected on main" | |
| git diff --stat | |
| exit 1 | |
| fi | |
| - name: Run full test suite | |
| run: node --test tests/unit/*.test.js tests/transforms/*.test.js tests/integration/*.test.js | |
| - name: Determine publish eligibility | |
| id: publish_gate | |
| run: | | |
| if [ -n "$NPM_TOKEN" ]; then | |
| echo "enabled=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "enabled=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Set nightly version | |
| if: steps.publish_gate.outputs.enabled == 'true' | |
| run: | | |
| BASE=$(node -p "require('./package.json').version") | |
| NIGHTLY="${BASE}-nightly.$(date +%Y%m%d)" | |
| npm version "$NIGHTLY" --no-git-tag-version | |
| - name: Regenerate runtime metadata | |
| if: steps.publish_gate.outputs.enabled == 'true' | |
| run: node scripts/generate.js | |
| - name: Verify npm package contents | |
| if: steps.publish_gate.outputs.enabled == 'true' | |
| run: npm run pack:verify | |
| - name: Publish nightly | |
| if: steps.publish_gate.outputs.enabled == 'true' | |
| run: node scripts/npm-publish-idempotent.js --tag nightly --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ env.NPM_TOKEN }} |