diff --git a/.github/workflows/publish-next.yml b/.github/workflows/publish-next.yml new file mode 100644 index 000000000..bfb3dbe6f --- /dev/null +++ b/.github/workflows/publish-next.yml @@ -0,0 +1,39 @@ +name: Publish Next + +on: + push: + branches: [main] + workflow_dispatch: + +concurrency: + group: publish-next-${{ github.ref }} + cancel-in-progress: true + +jobs: + publish: + runs-on: ubuntu-latest + timeout-minutes: 10 + permissions: + contents: read + id-token: write + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 24 + registry-url: "https://registry.npmjs.org" + + - name: Set next version + run: | + BASE_VERSION=$(node -p "require('./package.json').version") + DATE=$(date -u +%Y-%m-%d) + SHA=${GITHUB_SHA::8} + VERSION="${BASE_VERSION}-next.${DATE}.${SHA}" + npm version "$VERSION" --no-git-tag-version + + - name: Verify package contents + run: npm pack --dry-run + + - name: Publish to npm + run: npm publish --access public --tag next --provenance diff --git a/package.json b/package.json new file mode 100644 index 000000000..93ac06559 --- /dev/null +++ b/package.json @@ -0,0 +1,15 @@ +{ + "name": "@cloudflare/api-schemas", + "version": "0.0.0", + "description": "OpenAPI schemas for the Cloudflare API.", + "license": "BSD-3-Clause", + "files": ["openapi.json"], + "main": "./openapi.json", + "exports": { + ".": "./openapi.json", + "./openapi.json": "./openapi.json" + }, + "publishConfig": { + "access": "public" + } +}