From ab3008630595b546050f643c1ff883c35566c83f Mon Sep 17 00:00:00 2001 From: Lauren Tan Date: Tue, 6 Aug 2024 14:32:19 -0400 Subject: [PATCH] Update [ghstack-poisoned] --- .github/workflows/compiler_prereleases.yml | 51 +++++++++++++++++++ .../workflows/compiler_prereleases_manual.yml | 21 ++++++++ .../compiler_prereleases_nightly.yml | 20 ++++++++ compiler/scripts/release/ci-npmrc | 1 + 4 files changed, 93 insertions(+) create mode 100644 .github/workflows/compiler_prereleases.yml create mode 100644 .github/workflows/compiler_prereleases_manual.yml create mode 100644 .github/workflows/compiler_prereleases_nightly.yml create mode 100644 compiler/scripts/release/ci-npmrc diff --git a/.github/workflows/compiler_prereleases.yml b/.github/workflows/compiler_prereleases.yml new file mode 100644 index 0000000000000..a0cdea4112eae --- /dev/null +++ b/.github/workflows/compiler_prereleases.yml @@ -0,0 +1,51 @@ +name: (Compiler) Publish Prereleases + +on: + workflow_call: + inputs: + commit_sha: + required: true + default: '' + type: string + release_channel: + required: true + type: string + dist_tag: + required: true + type: string + secrets: + NPM_TOKEN: + required: true + +env: + TZ: /usr/share/zoneinfo/America/Los_Angeles + # https://github.com/actions/cache/blob/main/tips-and-workarounds.md#cache-segment-restore-timeout + SEGMENT_DOWNLOAD_TIMEOUT_MINS: 1 + GH_TOKEN: ${{ github.token }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + +defaults: + run: + working-directory: compiler + +jobs: + publish_prerelease: + name: Publish prelease (${{ inputs.release_channel }}) ${{ inputs.commit_sha }} @${{ inputs.dist_tag }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + cache: yarn + cache-dependency-path: compiler/yarn.lock + - name: Restore cached node_modules + uses: actions/cache@v4 + id: node_modules + with: + path: "**/node_modules" + key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('compiler/**/yarn.lock') }} + - run: yarn install --frozen-lockfile + - run: | + cp ./scripts/release/ci-npmrc ~/.npmrc + scripts/release/publish.js --ci --tags ${{ inputs.dist_tag }} diff --git a/.github/workflows/compiler_prereleases_manual.yml b/.github/workflows/compiler_prereleases_manual.yml new file mode 100644 index 0000000000000..87de411ddcb6e --- /dev/null +++ b/.github/workflows/compiler_prereleases_manual.yml @@ -0,0 +1,21 @@ +name: (Compiler) Publish Prereleases Manual + +on: + workflow_dispatch: + inputs: + prerelease_commit_sha: + required: false + +env: + TZ: /usr/share/zoneinfo/America/Los_Angeles + +jobs: + publish_prerelease_experimental: + name: Publish to Experimental channel + uses: facebook/react/.github/workflows/compiler_prereleases.yml@main + with: + commit_sha: ${{ inputs.prerelease_commit_sha || github.sha }} + release_channel: experimental + dist_tag: experimental + secrets: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/compiler_prereleases_nightly.yml b/.github/workflows/compiler_prereleases_nightly.yml new file mode 100644 index 0000000000000..90aafac4f631f --- /dev/null +++ b/.github/workflows/compiler_prereleases_nightly.yml @@ -0,0 +1,20 @@ +name: (Compiler) Publish Prereleases Nightly + +on: + schedule: + # At 10 minutes past 16:00 on Mon, Tue, Wed, Thu, and Fri + - cron: 10 16 * * 1,2,3,4,5 + +env: + TZ: /usr/share/zoneinfo/America/Los_Angeles + +jobs: + publish_prerelease_experimental: + name: Publish to Experimental channel + uses: facebook/react/.github/workflows/compiler_prereleases.yml@main + with: + commit_sha: ${{ github.sha }} + release_channel: experimental + dist_tag: experimental + secrets: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/compiler/scripts/release/ci-npmrc b/compiler/scripts/release/ci-npmrc new file mode 100644 index 0000000000000..ae643592e765c --- /dev/null +++ b/compiler/scripts/release/ci-npmrc @@ -0,0 +1 @@ +//registry.npmjs.org/:_authToken=${NPM_TOKEN}