Skip to content

Commit 0d6e355

Browse files
committed
completely remove npm-pacakges
1 parent edf2ac5 commit 0d6e355

File tree

1 file changed

+17
-77
lines changed

1 file changed

+17
-77
lines changed

.github/workflows/ci.yml

+17-77
Original file line numberDiff line numberDiff line change
@@ -439,20 +439,18 @@ jobs:
439439
name: lib-ocaml
440440
path: lib/ocaml
441441

442-
package:
443-
needs:
444-
- build-compiler
445-
- build-rewatch
446-
442+
pkg-pr-new:
443+
needs: [build-rewatch, build-compiler]
444+
if: github.event_name == 'pull_request'
447445
runs-on: ubuntu-24.04-arm
448-
449446
steps:
450447
- name: Checkout
451448
uses: actions/checkout@v4
452449

453450
- name: Use Node.js
454451
uses: actions/setup-node@v4
455452
with:
453+
cache: yarn
456454
node-version-file: .nvmrc
457455

458456
- name: Download artifacts
@@ -464,34 +462,13 @@ jobs:
464462
run: .github/workflows/moveArtifacts.sh
465463
shell: bash
466464

467-
- name: Check artifact list
468-
run: node ./scripts/npmPack.js
469-
470-
- name: yarn pack @rescript/* subpackages
471-
run: yarn workspaces foreach -W --no-private --exclude rescript pack
472-
473-
- name: Prepare package upload
474-
# For pull requests, pass the correct commit SHA explicitly as GITHUB_SHA points to the wrong commit.
475-
run: node .github/workflows/prepare_package_upload.js ${{ github.event.pull_request.head.sha }}
476-
477-
- name: "Upload artifact: npm packages"
478-
uses: actions/upload-artifact@v4
479-
with:
480-
name: npm-packages
481-
path: |
482-
rescript-${{ env.rescript_version }}.tgz
483-
rescript-std-${{ env.rescript_version }}.tgz
484-
rescript-linux-x64-${{ env.rescript_version }}.tgz
485-
rescript-linux-arm64-${{ env.rescript_version }}.tgz
486-
rescript-darwin-x64-${{ env.rescript_version }}.tgz
487-
rescript-darwin-arm64-${{ env.rescript_version }}.tgz
488-
rescript-win32-x64-${{ env.rescript_version }}.tgz
489-
490-
outputs:
491-
rescript_version: ${{ env.rescript_version }}
465+
- name: Publish packages to pkg.pr.new
466+
run: |
467+
yarn dlx pkg-pr-new publish "." "./packages/@rescript/*"
492468
493469
installationTest:
494-
needs: package
470+
needs: [pkg-pr-new]
471+
if: github.event_name == 'pull_request'
495472
strategy:
496473
fail-fast: false
497474
matrix:
@@ -506,9 +483,7 @@ jobs:
506483
node-target: linux-arm64
507484
- os: windows-latest
508485
node-target: win32-x64
509-
510486
runs-on: ${{ matrix.os }}
511-
512487
steps:
513488
- name: Checkout
514489
uses: actions/checkout@v4
@@ -531,17 +506,10 @@ jobs:
531506
echo "path=$dir" >> "$GITHUB_OUTPUT"
532507
cp -r tests/package_tests/installation_test/* "$dir"
533508
534-
- name: Download artifacts
535-
uses: actions/download-artifact@v4
536-
with:
537-
name: npm-packages
538-
path: ${{ steps.tmp-dir.outputs.path }}
539-
540509
- name: Install ReScript package
541510
run: |
542-
npm i --ignore-scripts --no-audit \
543-
rescript-${{ needs.package.outputs.rescript_version }}.tgz \
544-
rescript-${{ matrix.node-target }}-${{ needs.package.outputs.rescript_version }}.tgz
511+
COMMIT_SHA="$(git rev-parse --short HEAD)"
512+
npm i --no-audit "https://pkg.pr.new/rescript-lang/rescript@$COMMIT_SHA"
545513
shell: bash
546514
working-directory: ${{ steps.tmp-dir.outputs.path }}
547515

@@ -550,9 +518,9 @@ jobs:
550518
shell: bash
551519
working-directory: ${{ steps.tmp-dir.outputs.path }}
552520

553-
publish-pr:
554-
needs: [package, installationTest]
555-
if: github.event_name == 'pull_request'
521+
publish:
522+
needs: [build-rewatch, build-compiler]
523+
if: startsWith(github.ref, 'refs/tags/v')
556524
runs-on: ubuntu-24.04-arm
557525
steps:
558526
- name: Checkout
@@ -563,6 +531,7 @@ jobs:
563531
with:
564532
cache: yarn
565533
node-version-file: .nvmrc
534+
registry-url: https://registry.npmjs.org # Needed to make auth work for publishing
566535

567536
- name: Download artifacts
568537
uses: actions/download-artifact@v4
@@ -573,41 +542,12 @@ jobs:
573542
run: .github/workflows/moveArtifacts.sh
574543
shell: bash
575544

576-
- name: Publish packages to pkg.pr.new
577-
run: |
578-
yarn dlx pkg-pr-new publish "." "./packages/@rescript/*"
579-
580-
publish:
581-
needs: [package, installationTest]
582-
if: startsWith(github.ref, 'refs/tags/v')
583-
runs-on: ubuntu-24.04-arm
584-
steps:
585-
- name: Checkout
586-
uses: actions/checkout@v4
587-
588-
- name: Use Node.js
589-
uses: actions/setup-node@v4
590-
with:
591-
cache: yarn
592-
node-version-file: .nvmrc
593-
registry-url: https://registry.npmjs.org # Needed to make auth work for publishing
594-
595-
- name: Download artifacts
596-
uses: actions/download-artifact@v4
597-
with:
598-
name: npm-packages
599-
600545
- name: Publish packages on npm with tag "ci"
601546
env:
602547
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
603548
run: |
604-
npm publish --tag ci rescript-${{ needs.package.outputs.rescript_version }}.tgz
605-
npm publish --tag ci rescript-std-${{ needs.package.outputs.rescript_version }}.tgz
606-
npm publish --tag ci rescript-linux-x64-${{ needs.package.outputs.rescript_version }}.tgz
607-
npm publish --tag ci rescript-linux-arm64-${{ needs.package.outputs.rescript_version }}.tgz
608-
npm publish --tag ci rescript-darwin-x64-${{ needs.package.outputs.rescript_version }}.tgz
609-
npm publish --tag ci rescript-darwin-arm64-{{ needs.package.outputs.rescript_version }}.tgz
610-
npm publish --tag ci rescript-win32-x64-${{ needs.package.outputs.rescript_version }}.tgz
549+
yarn workspaces foreach -W --no-private \
550+
npm publish --tag ci
611551
612552
- name: Update Website Playground
613553
env:

0 commit comments

Comments
 (0)