From d84637989afd5322dff6d917ce8f4215be8b9cab Mon Sep 17 00:00:00 2001 From: Maarten Zuidhoorn Date: Fri, 17 Apr 2026 15:04:22 +0200 Subject: [PATCH 1/2] Publish release to GitHub after NPM --- .github/workflows/publish-release.yml | 42 ++++++++++++++++++--------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 5a80186..37c9209 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -10,9 +10,8 @@ on: PUBLISH_DOCS_TOKEN: required: true jobs: - publish-release: - permissions: - contents: write + build: + name: Build runs-on: ubuntu-latest steps: - name: Checkout and setup environment @@ -20,10 +19,8 @@ jobs: with: is-high-risk-environment: true ref: ${{ github.sha }} - - uses: MetaMask/action-publish-release@v3 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - run: yarn build + - name: Build + run: yarn build - name: Upload build artifacts uses: actions/upload-artifact@v7 with: @@ -35,13 +32,13 @@ jobs: ./node_modules/.yarn-state.yml publish-npm-dry-run: - needs: publish-release + name: Publish to NPM (dry run) + needs: build runs-on: ubuntu-latest steps: - - name: Checkout and setup environment - uses: MetaMask/action-checkout-and-setup@v3 + - name: Checkout repository + uses: actions/checkout@v6 with: - is-high-risk-environment: true ref: ${{ github.sha }} - name: Restore build artifacts uses: actions/download-artifact@v8 @@ -57,14 +54,14 @@ jobs: SKIP_PREPACK: true publish-npm: + name: Publish to NPM needs: publish-npm-dry-run runs-on: ubuntu-latest environment: npm-publish steps: - - name: Checkout and setup environment - uses: MetaMask/action-checkout-and-setup@v3 + - name: Checkout repository + uses: actions/checkout@v6 with: - is-high-risk-environment: true ref: ${{ github.sha }} - name: Restore build artifacts uses: actions/download-artifact@v8 @@ -80,6 +77,7 @@ jobs: SKIP_PREPACK: true get-release-version: + name: Get release version needs: publish-npm runs-on: ubuntu-latest outputs: @@ -113,3 +111,19 @@ jobs: destination_dir: latest secrets: PUBLISH_DOCS_TOKEN: ${{ secrets.PUBLISH_DOCS_TOKEN }} + + publish-release: + name: Publish release to GitHub + needs: publish-npm + permissions: + contents: write + runs-on: ubuntu-latest + steps: + - name: Checkout and setup environment + uses: MetaMask/action-checkout-and-setup@v3 + with: + is-high-risk-environment: true + ref: ${{ github.sha }} + - uses: MetaMask/action-publish-release@v3 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From ff690d0bce726ed932dca79a26bc9996ff85fa11 Mon Sep 17 00:00:00 2001 From: Maarten Zuidhoorn Date: Fri, 17 Apr 2026 15:36:28 +0200 Subject: [PATCH 2/2] Revert checkout and setup change --- .github/workflows/publish-release.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 37c9209..543ffe5 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -36,9 +36,10 @@ jobs: needs: build runs-on: ubuntu-latest steps: - - name: Checkout repository - uses: actions/checkout@v6 + - name: Checkout and setup environment + uses: MetaMask/action-checkout-and-setup@v3 with: + is-high-risk-environment: true ref: ${{ github.sha }} - name: Restore build artifacts uses: actions/download-artifact@v8 @@ -59,9 +60,10 @@ jobs: runs-on: ubuntu-latest environment: npm-publish steps: - - name: Checkout repository - uses: actions/checkout@v6 + - name: Checkout and setup environment + uses: MetaMask/action-checkout-and-setup@v3 with: + is-high-risk-environment: true ref: ${{ github.sha }} - name: Restore build artifacts uses: actions/download-artifact@v8 @@ -113,7 +115,7 @@ jobs: PUBLISH_DOCS_TOKEN: ${{ secrets.PUBLISH_DOCS_TOKEN }} publish-release: - name: Publish release to GitHub + name: Publish to GitHub needs: publish-npm permissions: contents: write