name: Build and publish JS on: workflow_call: inputs: concurrency: type: string required: true release-commit: description: "Commit to release" type: string required: true release-version: type: string required: true concurrency: group: ${{ inputs.concurrency }}-publish-js cancel-in-progress: true defaults: run: shell: bash --noprofile --norc -euo pipefail {0} permissions: contents: "write" id-token: "write" packages: "read" jobs: get-commit-sha: name: Get Commit Sha runs-on: ubuntu-latest outputs: short-sha: ${{ steps.get-short-sha.outputs.short-sha }} full-sha: ${{ steps.get-full-sha.outputs.full-sha }} steps: - name: "Set short-sha" id: get-short-sha run: echo "short-sha=$(echo ${{ inputs.release-commit }} | cut -c1-7)" >> $GITHUB_OUTPUT - name: "Set full-sha" id: get-full-sha run: echo "full-sha=${{ inputs.release-commit }}" >> $GITHUB_OUTPUT build: runs-on: ubuntu-latest-16-cores needs: [get-commit-sha] steps: - uses: actions/checkout@v4 with: ref: ${{ inputs.release-commit }} - uses: actions/setup-node@v4 with: node-version: "22.x" registry-url: "https://registry.npmjs.org" - name: Install Yarn run: npm install -g yarn - name: Set up Rust uses: ./.github/actions/setup-rust with: cache_key: "build-web" save_cache: false workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }} service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }} - uses: prefix-dev/setup-pixi@v0.10.0 with: pixi-version: v0.71.3 - name: Publish packages env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} run: | pixi run node rerun_js/scripts/publish.mjs - name: "Upload rerun_js to GCS (version)" uses: google-github-actions/upload-cloud-storage@v3 with: path: "rerun_js_package" destination: "rerun-builds/version/${{ inputs.release-version }}/rerun_js" parent: false process_gcloudignore: false headers: |- cache-control: no-cache, max-age=0 gzip: false # TODO(#11625): we need this for asset sync, in case the PR workflow fails (or doesn't run). See issue for details. - name: "Upload rerun_js to GCS (commit)" uses: google-github-actions/upload-cloud-storage@v3 with: path: "rerun_js_package" destination: "rerun-builds/commit/${{ needs.get-commit-sha.outputs.short-sha }}/rerun_js" parent: false process_gcloudignore: false headers: |- cache-control: no-cache, max-age=0 gzip: false