-
Notifications
You must be signed in to change notification settings - Fork 11
docs(release): restore alpha publishing and docs deployment [Codex] #355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| name: Release | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| workflow_dispatch: | ||
| inputs: | ||
| dry_run: | ||
| description: Run npm publish without publishing the package | ||
| required: true | ||
| default: true | ||
| type: boolean | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| publish: | ||
| runs-on: ubuntu-latest | ||
|
Comment on lines
+19
to
+20
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This standalone publish job installs dependencies and immediately packages the selected commit without running the repository's formatting, build, feature, test, or documentation checks, and it has no dependency on the CI workflow. A manual run with Useful? React with 👍 / 👎. |
||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v7 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v7 | ||
| with: | ||
| node-version: "24" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Useful? React with 👍 / 👎. |
||
| registry-url: https://registry.npmjs.org | ||
| package-manager-cache: false | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: get-npm-version | ||
| id: package-version | ||
| uses: martinbeentjes/npm-get-version-action@v1.3.1 | ||
|
|
||
| - name: Get short commit hash | ||
| id: vars | ||
| run: echo "COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV | ||
|
|
||
| - name: Update package version to -<commit-hash> | ||
| env: | ||
| PACKAGE_VERSION: ${{ steps.package-version.outputs.current-version }}-alpha-${{ env.COMMIT_HASH }} | ||
| run: | | ||
| node <<'NODE' | ||
| const fs = require("node:fs"); | ||
| const packageJsonPath = "package.json"; | ||
| const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf8")); | ||
| packageJson.version = process.env.PACKAGE_VERSION; | ||
| fs.writeFileSync(packageJsonPath, `${JSON.stringify(packageJson, null, 2)}\n`); | ||
| NODE | ||
|
|
||
| - name: Package npm package | ||
| run: npm pack | ||
|
|
||
| - name: Dry-run npm publish | ||
| if: github.event_name == 'pull_request' || inputs.dry_run | ||
| run: npm publish ./rescript-webapi-*.tgz --access public --tag alpha --dry-run | ||
|
|
||
| - name: Publish npm package | ||
| if: github.event_name == 'workflow_dispatch' && !inputs.dry_run | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When a caller dispatches this workflow with Useful? React with 👍 / 👎. |
||
| run: npm publish ./rescript-webapi-*.tgz --access public --tag alpha | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This workflow is triggered only for pull requests and manual dispatches. Since the same change removes the publishing steps from the main-push CI workflow, merging to
mainno longer publishes the commit-specific alpha release; releases occur only when someone manually dispatches this workflow, contrary to the restored main-branch release flow.Useful? React with 👍 / 👎.