Skip to content

Extract Netlify deployment into reusable workflow #14094

Extract Netlify deployment into reusable workflow

Extract Netlify deployment into reusable workflow #14094

Workflow file for this run

name: Build Status
on:
push:
branches:
- main
- 'next-*_*_*'
- 'fix-v*'
pull_request:
branches:
- main
- 'next-*_*_*'
- 'fix-v*'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
# Root jobs
warmup_pnpm_cache:
name: 'Warm up pnpm cache'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Install pnpm
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
- name: Using Node v24.x
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
id: pnpm-cache
with:
node-version: '24.x'
cache: 'pnpm'
- name: Update pnpm cache
if: steps.pnpm-cache.outputs.cache-hit != 'true'
run: pnpm install --frozen-lockfile
warmup_pnpm_cache_others:
name: 'Warm up pnpm cache (others)'
runs-on: ${{matrix.os}}
strategy:
matrix:
os: ['macos-latest', 'windows-latest']
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Install pnpm
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
- name: Using Node v24.x
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
id: pnpm-cache
with:
node-version: '24.x'
cache: 'pnpm'
- name: Update pnpm cache
if: steps.pnpm-cache.outputs.cache-hit != 'true'
run: pnpm install --frozen-lockfile
# Jobs without any strong requirement on warmup_pnpm_cache
# except that they have to wait for it to avoid setting an empty cache that would replace the one pushed by warmup_pnpm_cache
no_dedupe_required:
name: 'No dedupe required'
needs: warmup_pnpm_cache
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
- name: Install pnpm
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
- name: Using Node v24.x
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version: '24.x'
cache: 'pnpm'
- name: Ensure no dedupe required
run: pnpm dedupe --check
package_quality:
name: 'Package quality'
needs: warmup_pnpm_cache
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Install pnpm
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
- name: Using Node v24.x
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version: '24.x'
cache: 'pnpm'
- name: Check package score using skypack
run: cd packages/fast-check && pnpm dlx @skypack/package-check
# Jobs requesting warmup_pnpm_cache
format_lint:
name: 'Format & Lint'
needs: warmup_pnpm_cache
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Install pnpm
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
- name: Using Node v24.x
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version: '24.x'
cache: 'pnpm'
- name: Install dependencies
run: pnpm --filter @fast-check/monorepo install --frozen-lockfile
- name: Check format
run: node --run format:check
- name: Check lint
run: node --run lint:check
production_packages:
name: 'Build production packages'
needs: warmup_pnpm_cache
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Install pnpm
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
- name: Using Node v24.x
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version: '24.x'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build production packages
run: node --run build-ci:all
- name: Create bundles
run: node --run pack:all
- name: Upload production packages
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: bundles
path: packages/**/package.tgz
if-no-files-found: error
retention-days: 1
# Jobs requesting warmup_pnpm_cache AND production_packages
typecheck:
name: 'Typecheck'
needs:
- warmup_pnpm_cache
- production_packages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Install pnpm
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
- name: Using Node v24.x
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version: '24.x'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Download production packages
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
name: bundles
path: packages/
- name: Unpack production packages
run: node --run unpack:all
- name: Typecheck
run: node --run typecheck:all
preview:
name: 'Preview'
needs:
- warmup_pnpm_cache
- production_packages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Install pnpm
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
- name: Using Node v24.x
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version: '24.x'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Download production packages
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
name: bundles
path: packages/
- name: Unpack production packages
run: node --run unpack:all
- name: Preview (no comment)
if: github.event_name != 'pull_request'
run: pnpm dlx pkg-pr-new publish --compact './packages/*' --template './examples' --comment=off
- name: Preview
if: github.event_name == 'pull_request'
run: pnpm dlx pkg-pr-new publish --compact './packages/*' --template './examples'
test:
name: 'Test'
needs:
- warmup_pnpm_cache
- warmup_pnpm_cache_others
- production_packages
runs-on: ${{matrix.os}}
strategy:
matrix:
node-version: [20.x, 22.x, 24.x, latest]
os: ['ubuntu-latest']
shard: ['1/1']
include:
- node-version: 24.x
os: 'macos-latest'
shard: '1/1'
- node-version: 24.x
os: 'windows-latest'
shard: '1/2'
- node-version: 24.x
os: 'windows-latest'
shard: '2/2'
env:
ENABLE_COVERAGE: ${{ matrix.os == 'macos-latest' }}
SKIP_EXPENSIVE: ${{ matrix.os == 'windows-latest' }}
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Install pnpm
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
- name: Using Node v${{matrix.node-version}}
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version: ${{matrix.node-version}}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Download production packages
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
name: bundles
path: packages/
- name: Unpack production packages
if: matrix.os != 'windows-latest'
run: pnpm run unpack:all
- name: Unpack production packages (Windows only)
if: matrix.os == 'windows-latest'
# untar seems to fail on Windows when untaring already existing files
run: pnpm run unpack:all || true
- name: Unit tests
shell: bash -l {0}
# The DEFAULT_SEED might be used by some of the packages and might be ignored by others
# It's aim is to help to diagnose infinite loop that may occur during tests and cannot be stopped by fast-check itself
run: |
export EXPECT_DEFAULT_SEED="true"
export DEFAULT_SEED=$(node -p "Date.now() ^ (Math.random() * 0x100000000)")
export FAST_CI_RUN=$("${ENABLE_COVERAGE}" = "true")
echo "DEFAULT_SEED is: ${DEFAULT_SEED}"
if [ "${ENABLE_COVERAGE}" = "true" ]; then
pnpm run test:coverage --shard=${{matrix.shard}}
else
pnpm run test --shard=${{matrix.shard}}
fi
- name: Codecov
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
if: env.ENABLE_COVERAGE == 'true'
with:
name: tests
flags: tests, tests-against-${{matrix.node-version}}-on-${{runner.os}}
token: ${{secrets.CODECOV_TOKEN}}
fail_ci_if_error: true # default: false
verbose: false # default: false
documentation:
name: 'Build documentation'
needs:
- warmup_pnpm_cache
- production_packages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0 # all history in order to be able to show last-edited-at dates
- name: Install pnpm
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
- name: Using Node v24.x
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version: '24.x'
cache: 'pnpm'
- name: Install dependencies
run: pnpm --filter website install --frozen-lockfile
- name: Download production packages
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
name: bundles
path: packages/
- name: Unpack production packages
run: node --run unpack:all
- name: Get date cache buster
id: get-date
shell: bash
run: echo "date=$(/bin/date -u "+%Y%m")" >> $GITHUB_OUTPUT
- name: Cache for assets
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: |
website/static/img/sponsors.svg
website/static/img/_
website/static/img/**/*.gif
website/static/img/**/*.png
key: assets-${{steps.get-date.outputs.date}}-${{hashFiles('.all-contributorsrc', 'website/prebuild/optimize-images.mjs')}}
- name: Generate documentation
run: pnpm --filter website run build
- name: Generate API reference
run: |
pnpm --filter fast-check install --frozen-lockfile
pnpm --filter fast-check run docs-ci
- name: Copy API reference within documentation
run: mv packages/fast-check/docs website/build/api-reference
- name: Copy raw logo within documentation
run: cp website/static/img/logo.png website/build/assets/images/logo.png
- name: Upload documentation artifacts
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: website
path: website/build/
if-no-files-found: error
retention-days: 1
test_bundle:
name: 'Test bundle'
needs:
- warmup_pnpm_cache
- production_packages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Install pnpm
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
- name: Using Node v24.x
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version: '24.x'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Download production packages
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
name: bundles
path: packages/
- name: Unpack production packages
run: node --run unpack:all
- name: Alter internals to behave as if published
run: pnpm --filter {./packages/**} --parallel exec $(pnpm bin)/packaged --keep-node-modules
- name: Retrieve potentially dropped test-bundle
run: pnpm --filter {./packages/**} --parallel -c --workspace-concurrency=1 exec "git restore -s@ -SW -- test-bundle || true"
- name: Check publication lint
run: node --run publint:all
- name: Check bundles
run: pnpm --filter {./packages/**} --parallel run test-bundle
- name: Check legacy bundles
run: |
export NODE_VERSION="$(node --version)"
export NVS_HOME="$HOME/.nvs"
git clone --branch v1.7.1 --depth 1 https://github.com/jasongin/nvs "$NVS_HOME"
if [ "$(git -C "$NVS_HOME" rev-parse HEAD)" != "b87ae9593cd20e7b667e9099240c9befeb50659f" ]; then
echo "ERROR: HEAD is not the expected commit hash"
exit 1
fi
chmod +x "$NVS_HOME/nvs"
export PATH="$PATH:$NVS_HOME"
if [ "$(node --version)" != "$NODE_VERSION" ]; then
echo "ERROR: Node version got updated from $NODE_VERSION to $(node --version)"
exit 2
fi
pnpm --filter {./packages/**} --parallel run test-legacy-bundle
if [ "$(node --version)" != "$NODE_VERSION" ]; then
echo "ERROR: Node version got updated from $NODE_VERSION to $(node --version)"
exit 3
fi
test_types:
name: 'Test types'
needs:
- warmup_pnpm_cache
- production_packages
runs-on: ubuntu-latest
strategy:
matrix:
ts-version:
# Latest version of TypeScript
- 'latest'
# Various intermediate versions of Typescript (if any required)
- '5.7' # First version adding generics on Uint8Array
# Minimal requirement for TypeScript
- '5.0'
# Other release channels for TypeScript
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Install pnpm
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
- name: Using Node v24.x
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version: '24.x'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Download production packages
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
name: bundles
path: packages/
- name: Unpack production packages
run: node --run unpack:all
- name: Alter internals to behave as if published
run: pnpm --filter {./packages/**} --parallel exec $(pnpm bin)/packaged --keep-node-modules
- name: Retrieve dropped test-types
run: pnpm --filter {./packages/**} --parallel -c --workspace-concurrency=1 exec "git restore -s@ -SW -- test-types"
- name: Switch folder to CommonJS
run: pnpm --filter {./packages/**} --parallel -c exec "cd test-types && ../../../.github/scripts/rename.sh ts cts"
- name: Check in CommonJS mode
run: pnpm --filter {./packages/**} --parallel -c exec "cd test-types && pnpm --package typescript@${{ matrix.ts-version }} dlx tsc --noEmit --skipLibCheck --strict *.cts"
- name: Check in CommonJS mode with NodeNext
run: pnpm --filter {./packages/**} --parallel -c exec "cd test-types && pnpm --package typescript@${{ matrix.ts-version }} dlx tsc --noEmit --skipLibCheck --strict --module NodeNext --moduleResolution NodeNext *.cts"
- name: Switch folder to ES Modules
run: pnpm --filter {./packages/**} --parallel -c exec "cd test-types && ../../../.github/scripts/rename.sh cts mts"
- name: Check in ES Modules mode
run: pnpm --filter {./packages/**} --parallel -c exec "cd test-types && pnpm --package typescript@${{ matrix.ts-version }} dlx tsc --noEmit --skipLibCheck --strict *.mts"
- name: Check in ES Modules mode with NodeNext
run: pnpm --filter {./packages/**} --parallel -c exec "cd test-types && pnpm --package typescript@${{ matrix.ts-version }} dlx tsc --noEmit --skipLibCheck --strict --module NodeNext --moduleResolution NodeNext *.mts"
- name: Check in ES Modules mode with exactOptionalPropertyTypes
run: |
pnpm --filter {./packages/**} --parallel -c exec "sed -i 's/fc-expect-error-require-exactOptionalPropertyTypes/ts-expect-error/g' test-types/*.mts"
pnpm --filter {./packages/**} --parallel -c exec "cd test-types && pnpm --package typescript@${{ matrix.ts-version }} dlx tsc --noEmit --skipLibCheck --strict --exactOptionalPropertyTypes *.mts"
# Job to confirm every required job passed
pre_all_checks_passed:
name: 'Pre All checks passed'
needs:
- production_packages
- documentation
- format_lint
- no_dedupe_required
- package_quality
- typecheck
- test
- test_bundle
- test_types
runs-on: ubuntu-latest
steps:
- name: Success
run: echo "Success"
all_checks_passed:
name: 'All checks passed'
needs: pre_all_checks_passed
if: always()
runs-on: ubuntu-latest
steps:
- if: needs.pre_all_checks_passed.result == 'success'
name: Success
run: echo "Success"
- if: needs.pre_all_checks_passed.result != 'success'
name: Failure
run: exit 1
# Publication jobs
publish_documentation_netlify:

Check failure on line 464 in .github/workflows/build-status.yml

View workflow run for this annotation

GitHub Actions / Build Status

Invalid workflow file

The workflow is not valid. .github/workflows/build-status.yml (Line: 464, Col: 3): Error calling workflow 'dubzzz/fast-check/.github/workflows/deploy-documentation-netlify.yml@57038c35344af1511e160d239f74a9ea0507d128'. The workflow is requesting 'contents: read', but is only allowed 'contents: none'.
name: 'Publish documentation on Netlify'
needs: documentation
permissions:
pull-requests: write
uses: ./.github/workflows/deploy-documentation-netlify.yml
secrets: inherit
with:
pr_number: ${{ github.event_name == 'pull_request' && github.event.pull_request.number || 0 }}
draft: ${{ github.event_name != 'push' || github.ref != 'refs/heads/main' }}
artifact_name: 'website'
check_any_package:
name: 'Check publish any package'
needs: all_checks_passed
if: github.event_name == 'push'
runs-on: ubuntu-latest
outputs:
tag_count: ${{steps.tag_count.outputs.count}}
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
- id: tag_count
name: Check if one tag matches the package
run: |
echo -n "count=" >> "$GITHUB_OUTPUT"
git tag --points-at HEAD | wc -l >> "$GITHUB_OUTPUT"
check_publish_fc:
name: Check publish fast-check
needs: check_any_package
if: needs.check_any_package.outputs.tag_count != '0'
runs-on: ubuntu-latest
outputs:
status: ${{steps.check_has_tag.outcome}}
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
- id: check_has_tag
name: Check if one tag matches the package
run: git tag --points-at HEAD | grep '^v[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*'
continue-on-error: true
publish_package_fc:
name: Publish fast-check
needs: check_publish_fc
if: needs.check_publish_fc.outputs.status == 'success'
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
attestations: write
steps:
- name: Using Node v24.x
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version: '24.x'
registry-url: 'https://registry.npmjs.org'
check-latest: true
- name: Download production packages
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
name: bundles
path: packages/
- uses: step-security/wait-for-secrets@084b3ae774c0e0003a9307ae4f487c10f1f998fe # v1.2.1
id: wait-for-secrets
with:
secrets: |
OTP:
name: 'OTP to publish package'
description: 'OTP from authenticator app'
- name: Publish fast-check
run: npm publish --access public --otp ${{steps.wait-for-secrets.outputs.OTP}} --tag ${{env.PUBLISH_TAG}} packages/fast-check/package.tgz
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
PUBLISH_TAG: ${{github.ref == 'refs/heads/main' && 'latest' || startsWith(github.ref, 'refs/heads/next-') && 'next' || 'legacy'}}
- uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3.0.0
with:
subject-path: packages/fast-check/package.tgz
check_publish_ava:
name: Check publish @fast-check/ava
needs: check_any_package
if: needs.check_any_package.outputs.tag_count != '0'
runs-on: ubuntu-latest
outputs:
status: ${{steps.check_has_tag.outcome}}
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
- id: check_has_tag
name: Check if one tag matches the package
run: git tag --points-at HEAD | grep '^ava/v[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*'
continue-on-error: true
publish_package_ava:
name: Publish @fast-check/ava
needs: check_publish_ava
if: needs.check_publish_ava.outputs.status == 'success'
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
attestations: write
steps:
- name: Using Node v24.x
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version: '24.x'
registry-url: 'https://registry.npmjs.org'
check-latest: true
- name: Download production packages
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
name: bundles
path: packages/
- uses: step-security/wait-for-secrets@084b3ae774c0e0003a9307ae4f487c10f1f998fe # v1.2.1
id: wait-for-secrets
with:
secrets: |
OTP:
name: 'OTP to publish package'
description: 'OTP from authenticator app'
- name: Publish @fast-check/ava
run: npm publish --access public --otp ${{steps.wait-for-secrets.outputs.OTP}} --tag ${{env.PUBLISH_TAG}} packages/ava/package.tgz
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
PUBLISH_TAG: ${{github.ref == 'refs/heads/main' && 'latest' || startsWith(github.ref, 'refs/heads/next-') && 'next' || 'legacy'}}
- uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3.0.0
with:
subject-path: packages/ava/package.tgz
check_publish_jest:
name: Check publish @fast-check/jest
needs: check_any_package
if: needs.check_any_package.outputs.tag_count != '0'
runs-on: ubuntu-latest
outputs:
status: ${{steps.check_has_tag.outcome}}
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
- id: check_has_tag
name: Check if one tag matches the package
run: git tag --points-at HEAD | grep '^jest/v[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*'
continue-on-error: true
publish_package_jest:
name: Publish @fast-check/jest
needs: check_publish_jest
if: needs.check_publish_jest.outputs.status == 'success'
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
attestations: write
steps:
- name: Using Node v24.x
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version: '24.x'
registry-url: 'https://registry.npmjs.org'
check-latest: true
- name: Download production packages
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
name: bundles
path: packages/
- uses: step-security/wait-for-secrets@084b3ae774c0e0003a9307ae4f487c10f1f998fe # v1.2.1
id: wait-for-secrets
with:
secrets: |
OTP:
name: 'OTP to publish package'
description: 'OTP from authenticator app'
- name: Publish @fast-check/jest
run: npm publish --access public --otp ${{steps.wait-for-secrets.outputs.OTP}} --tag ${{env.PUBLISH_TAG}} packages/jest/package.tgz
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
PUBLISH_TAG: ${{github.ref == 'refs/heads/main' && 'latest' || startsWith(github.ref, 'refs/heads/next-') && 'next' || 'legacy'}}
- uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3.0.0
with:
subject-path: packages/jest/package.tgz
check_publish_packaged:
name: Check publish @fast-check/packaged
needs: check_any_package
if: needs.check_any_package.outputs.tag_count != '0'
runs-on: ubuntu-latest
outputs:
status: ${{steps.check_has_tag.outcome}}
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
- id: check_has_tag
name: Check if one tag matches the package
run: git tag --points-at HEAD | grep '^packaged/v[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*'
continue-on-error: true
publish_package_packaged:
name: Publish @fast-check/packaged
needs: check_publish_packaged
if: needs.check_publish_packaged.outputs.status == 'success'
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
attestations: write
steps:
- name: Using Node v24.x
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version: '24.x'
registry-url: 'https://registry.npmjs.org'
check-latest: true
- name: Download production packages
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
name: bundles
path: packages/
- uses: step-security/wait-for-secrets@084b3ae774c0e0003a9307ae4f487c10f1f998fe # v1.2.1
id: wait-for-secrets
with:
secrets: |
OTP:
name: 'OTP to publish package'
description: 'OTP from authenticator app'
- name: Publish @fast-check/packaged
run: npm publish --access public --otp ${{steps.wait-for-secrets.outputs.OTP}} --tag ${{env.PUBLISH_TAG}} packages/packaged/package.tgz
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
PUBLISH_TAG: ${{github.ref == 'refs/heads/main' && 'latest' || startsWith(github.ref, 'refs/heads/next-') && 'next' || 'legacy'}}
- uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3.0.0
with:
subject-path: packages/packaged/package.tgz
check_publish_poisoning:
name: Check publish @fast-check/poisoning
needs: check_any_package
if: needs.check_any_package.outputs.tag_count != '0'
runs-on: ubuntu-latest
outputs:
status: ${{steps.check_has_tag.outcome}}
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
- id: check_has_tag
name: Check if one tag matches the package
run: git tag --points-at HEAD | grep '^poisoning/v[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*'
continue-on-error: true
publish_package_poisoning:
name: Publish @fast-check/poisoning
needs: check_publish_poisoning
if: needs.check_publish_poisoning.outputs.status == 'success'
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
attestations: write
steps:
- name: Using Node v24.x
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version: '24.x'
registry-url: 'https://registry.npmjs.org'
check-latest: true
- name: Download production packages
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
name: bundles
path: packages/
- uses: step-security/wait-for-secrets@084b3ae774c0e0003a9307ae4f487c10f1f998fe # v1.2.1
id: wait-for-secrets
with:
secrets: |
OTP:
name: 'OTP to publish package'
description: 'OTP from authenticator app'
- name: Publish @fast-check/poisoning
run: npm publish --access public --otp ${{steps.wait-for-secrets.outputs.OTP}} --tag ${{env.PUBLISH_TAG}} packages/poisoning/package.tgz
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
PUBLISH_TAG: ${{github.ref == 'refs/heads/main' && 'latest' || startsWith(github.ref, 'refs/heads/next-') && 'next' || 'legacy'}}
- uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3.0.0
with:
subject-path: packages/poisoning/package.tgz
check_publish_vitest:
name: Check publish @fast-check/vitest
needs: check_any_package
if: needs.check_any_package.outputs.tag_count != '0'
runs-on: ubuntu-latest
outputs:
status: ${{steps.check_has_tag.outcome}}
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
- id: check_has_tag
name: Check if one tag matches the package
run: git tag --points-at HEAD | grep '^vitest/v[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*'
continue-on-error: true
publish_package_vitest:
name: Publish @fast-check/vitest
needs: check_publish_vitest
if: needs.check_publish_vitest.outputs.status == 'success'
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
attestations: write
steps:
- name: Using Node v24.x
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version: '24.x'
registry-url: 'https://registry.npmjs.org'
check-latest: true
- name: Download production packages
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
name: bundles
path: packages/
- uses: step-security/wait-for-secrets@084b3ae774c0e0003a9307ae4f487c10f1f998fe # v1.2.1
id: wait-for-secrets
with:
secrets: |
OTP:
name: 'OTP to publish package'
description: 'OTP from authenticator app'
- name: Publish @fast-check/vitest
run: npm publish --access public --otp ${{steps.wait-for-secrets.outputs.OTP}} --tag ${{env.PUBLISH_TAG}} packages/vitest/package.tgz
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
PUBLISH_TAG: ${{github.ref == 'refs/heads/main' && 'latest' || startsWith(github.ref, 'refs/heads/next-') && 'next' || 'legacy'}}
- uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3.0.0
with:
subject-path: packages/vitest/package.tgz
check_publish_worker:
name: Check publish @fast-check/worker
needs: check_any_package
if: needs.check_any_package.outputs.tag_count != '0'
runs-on: ubuntu-latest
outputs:
status: ${{steps.check_has_tag.outcome}}
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
- id: check_has_tag
name: Check if one tag matches the package
run: git tag --points-at HEAD | grep '^worker/v[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*'
continue-on-error: true
publish_package_worker:
name: Publish @fast-check/worker
needs: check_publish_worker
if: needs.check_publish_worker.outputs.status == 'success'
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
attestations: write
steps:
- name: Using Node v24.x
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version: '24.x'
registry-url: 'https://registry.npmjs.org'
check-latest: true
- name: Download production packages
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
name: bundles
path: packages/
- uses: step-security/wait-for-secrets@084b3ae774c0e0003a9307ae4f487c10f1f998fe # v1.2.1
id: wait-for-secrets
with:
secrets: |
OTP:
name: 'OTP to publish package'
description: 'OTP from authenticator app'
- name: Publish @fast-check/worker
run: npm publish --access public --otp ${{steps.wait-for-secrets.outputs.OTP}} --tag ${{env.PUBLISH_TAG}} packages/worker/package.tgz
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
PUBLISH_TAG: ${{github.ref == 'refs/heads/main' && 'latest' || startsWith(github.ref, 'refs/heads/next-') && 'next' || 'legacy'}}
- uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3.0.0
with:
subject-path: packages/worker/package.tgz
check_publish_expect_type:
name: Check publish @fast-check/expect-type
needs: check_any_package
if: needs.check_any_package.outputs.tag_count != '0'
runs-on: ubuntu-latest
outputs:
status: ${{steps.check_has_tag.outcome}}
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
- id: check_has_tag
name: Check if one tag matches the package
run: git tag --points-at HEAD | grep '^expect-type/v[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*'
continue-on-error: true
publish_package_expect_type:
name: Publish @fast-check/expect-type
needs: check_publish_expect_type
if: needs.check_publish_expect_type.outputs.status == 'success'
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
attestations: write
steps:
- name: Using Node v24.x
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version: '24.x'
registry-url: 'https://registry.npmjs.org'
check-latest: true
- name: Download production packages
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
name: bundles
path: packages/
- uses: step-security/wait-for-secrets@084b3ae774c0e0003a9307ae4f487c10f1f998fe # v1.2.1
id: wait-for-secrets
with:
secrets: |
OTP:
name: 'OTP to publish package'
description: 'OTP from authenticator app'
- name: Publish @fast-check/expect-type
run: npm publish --access public --otp ${{steps.wait-for-secrets.outputs.OTP}} --tag ${{env.PUBLISH_TAG}} packages/expect-type/package.tgz
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
PUBLISH_TAG: ${{github.ref == 'refs/heads/main' && 'latest' || startsWith(github.ref, 'refs/heads/next-') && 'next' || 'legacy'}}
- uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3.0.0
with:
subject-path: packages/expect-type/package.tgz