From d4a6153ac5a14a7a8a5d3efebaa7a751d7ff0922 Mon Sep 17 00:00:00 2001 From: IWANABETHATGUY Date: Tue, 4 Apr 2023 11:27:14 +0800 Subject: [PATCH 1/2] =?UTF-8?q?chore:=20=F0=9F=A4=96=20release=20pre=20che?= =?UTF-8?q?ck?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 46 +++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 65698264a0ae..95fb91c2b08f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -452,3 +452,49 @@ jobs: REPOSITORY: ${{ github.repository }} REF: ${{ github.ref }} ONLY_RELEASE_TAG: true + + release-pre-check: + name: Release pre check + permissions: + contents: write + runs-on: ubuntu-latest + needs: + - build-x86_64-unknown-linux-gnu + if: ${{ github.event_name == 'workflow_dispatch' }} + steps: + - name: Checkout Repo + uses: actions/checkout@master + with: + # This makes Actions fetch only one branch to release + fetch-depth: 1 + - uses: actions/setup-node@v3 + with: + node-version: "16" + - name: Setup node dependencies + run: | + npm install -g pnpm@7.25.0 + pnpm install + - name: Download artifacts + uses: actions/download-artifact@v3 + with: + path: artifacts + - name: Build node packages + run: pnpm run build:js + - name: Move artifacts + run: node scripts/build-npm.js + - name: Show binding packages + run: ls -R npm + - name: Link optional dependencies + run: pnpm install --no-frozen-lockfile + with: + # this expects you to have a script called release which does a build for your packages and calls changeset publish + version: ${{ github.event.inputs.version }} + type: "release" + branch: ${{ github.ref_name }} + tools: "changeset" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + REPOSITORY: ${{ github.repository }} + REF: ${{ github.ref }} + ONLY_RELEASE_TAG: true From 65db030e67edd787da2fdffc211aad05d14b0cf1 Mon Sep 17 00:00:00 2001 From: IWANABETHATGUY Date: Tue, 4 Apr 2023 14:58:20 +0800 Subject: [PATCH 2/2] =?UTF-8?q?chore:=20=F0=9F=A4=96=20cacnel=20release=20?= =?UTF-8?q?workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 95fb91c2b08f..5ba4ab2f650d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -498,3 +498,6 @@ jobs: REPOSITORY: ${{ github.repository }} REF: ${{ github.ref }} ONLY_RELEASE_TAG: true + - name: Cancel the whole release if the pre check is failed. + uses: andymckay/cancel-action@0.3 + if: ${{ !success() }}