From 70111d0e8dc99bed6f7912d8701c60e9a8da8675 Mon Sep 17 00:00:00 2001 From: Arda Nakisci Date: Thu, 21 May 2026 09:55:58 +0200 Subject: [PATCH 1/3] Test raindex npm release from PR --- .github/workflows/npm-package-release.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/npm-package-release.yml b/.github/workflows/npm-package-release.yml index 9cb7d62ab5..fe32212d60 100644 --- a/.github/workflows/npm-package-release.yml +++ b/.github/workflows/npm-package-release.yml @@ -3,10 +3,13 @@ on: push: branches: - main + pull_request: + branches: + - main jobs: release: # skip this job if the commit was created by this workflow (prevents infinite loop) - if: ${{ github.ref == 'refs/heads/main' && !startsWith(github.event.head_commit.message, 'NPM Package Release') }} + if: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) || (github.ref == 'refs/heads/main' && !startsWith(github.event.head_commit.message, 'NPM Package Release')) }} runs-on: ubuntu-latest permissions: id-token: write @@ -31,6 +34,7 @@ jobs: - uses: actions/checkout@v4 with: ssh-key: ${{ secrets.PUBLISH_PRIVATE_KEY }} + ref: ${{ github.head_ref || github.ref_name }} # WASM builds require significant disk space; free up space to prevent build failures - name: Free disk space uses: jlumbroso/free-disk-space@v1.3.1 @@ -154,12 +158,12 @@ jobs: - name: Set Version if: ${{ env.OLD_HASH != env.NEW_HASH }} run: | - npm version prerelease --preid alpha --no-git-tag-version -w @rainlanguage/raindex + npm version prerelease --preid alpha --no-git-tag-version --no-workspaces-update -w @rainlanguage/raindex RAINDEX_NEW_VERSION=$(jq -r '.version' ./packages/raindex/package.json) echo "RAINDEX_NEW_VERSION=$RAINDEX_NEW_VERSION" >> $GITHUB_ENV jq --arg v "$RAINDEX_NEW_VERSION" '.dependencies."@rainlanguage/raindex" = $v' ./packages/ui-components/package.json > tmp.json && mv tmp.json ./packages/ui-components/package.json npx prettier --write ./packages/ui-components/package.json - npm version prerelease --preid alpha --no-git-tag-version -w @rainlanguage/ui-components + npm version prerelease --preid alpha --no-git-tag-version --no-workspaces-update -w @rainlanguage/ui-components UC_NEW_VERSION=$(jq -r '.version' ./packages/ui-components/package.json) echo "UC_NEW_VERSION=$UC_NEW_VERSION" >> $GITHUB_ENV jq --indent 4 --arg rd "$RAINDEX_NEW_VERSION" --arg uc "$UC_NEW_VERSION" ' @@ -210,7 +214,7 @@ jobs: - name: Push Changes To Remote if: ${{ env.OLD_HASH != env.NEW_HASH }} run: | - git push origin + git push origin HEAD:${{ github.head_ref || github.ref_name }} git push -u origin "npm-raindex-v${{ env.RAINDEX_NEW_VERSION }}-uc-v${{ env.UC_NEW_VERSION }}" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From af38fbb3dc1efb9362fa2f4f8e4d7deb62f6234c Mon Sep 17 00:00:00 2001 From: Arda Nakisci Date: Thu, 21 May 2026 10:36:55 +0200 Subject: [PATCH 2/3] Add raindex npm bootstrap publish workflow --- .../npm-raindex-bootstrap-publish.yml | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/npm-raindex-bootstrap-publish.yml diff --git a/.github/workflows/npm-raindex-bootstrap-publish.yml b/.github/workflows/npm-raindex-bootstrap-publish.yml new file mode 100644 index 0000000000..69c49ef3de --- /dev/null +++ b/.github/workflows/npm-raindex-bootstrap-publish.yml @@ -0,0 +1,49 @@ +name: Bootstrap raindex NPM Publish + +on: + workflow_dispatch: + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + contents: read + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + steps: + - uses: actions/checkout@v4 + + - name: Free disk space + uses: jlumbroso/free-disk-space@v1.3.1 + with: + swap-storage: false + + - uses: DeterminateSystems/nix-installer-action@main + with: + determinate: true + + - uses: DeterminateSystems/flakehub-cache-action@main + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "24.x" + registry-url: "https://registry.npmjs.org" + + - name: Verify npm token auth + run: npm whoami + + - name: Install dependencies + run: ./prep-base.sh + + - name: Build raindex package + run: nix develop -c npm run build -w @rainlanguage/raindex + + - name: Publish raindex package + run: | + RAINDEX_VERSION=$(jq -r '.version' ./packages/raindex/package.json) + if npm view "@rainlanguage/raindex@${RAINDEX_VERSION}" version >/dev/null 2>&1; then + echo "@rainlanguage/raindex@${RAINDEX_VERSION} is already published" + exit 0 + fi + npm publish -w @rainlanguage/raindex --access public --tag bootstrap --verbose From 331cd86e20e88aed1ce0d9ea564cb7b286f6add1 Mon Sep 17 00:00:00 2001 From: Arda Nakisci Date: Thu, 21 May 2026 10:40:46 +0200 Subject: [PATCH 3/3] Trigger raindex bootstrap publish from PR --- .github/workflows/npm-raindex-bootstrap-publish.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/npm-raindex-bootstrap-publish.yml b/.github/workflows/npm-raindex-bootstrap-publish.yml index 69c49ef3de..9d24df4c56 100644 --- a/.github/workflows/npm-raindex-bootstrap-publish.yml +++ b/.github/workflows/npm-raindex-bootstrap-publish.yml @@ -1,10 +1,14 @@ name: Bootstrap raindex NPM Publish on: + pull_request: + branches: + - main workflow_dispatch: jobs: publish: + if: ${{ github.head_ref == 'fix-raindex-npm-release-pr-trigger' || github.ref_name == 'fix-raindex-npm-release-pr-trigger' }} runs-on: ubuntu-latest permissions: contents: read