From 18bdae8fef971933a60c07316d641b0a013040aa Mon Sep 17 00:00:00 2001 From: Peter Smith Date: Wed, 29 Jan 2025 18:38:16 +0000 Subject: [PATCH] chore: migrate release (#3642) * chore: add environment * chore: comment out cross-repo requirements * fix: correct env var name --------- Co-authored-by: Mike Christopher Co-authored-by: Anderson Arboleya --- .github/workflows/release.yaml | 39 ++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 18fde5f5bb9..665b92995ae 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -12,6 +12,7 @@ jobs: release: name: "Release" runs-on: ubuntu-latest + environment: npm-deploy permissions: write-all # Ensure that the workflow runs only after a commit is pushed into the branch # and not when the branch is created. @@ -42,7 +43,7 @@ jobs: - name: Ensure NPM access run: npm whoami env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.NPM_DEPLOY_TOKEN }} - name: Build run: pnpm build @@ -74,7 +75,7 @@ jobs: githubTagName: ${{ env.RELEASE_VERSION }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.NPM_DEPLOY_TOKEN }} - name: Prettify changelog run: pnpm changeset:update-changelog @@ -108,7 +109,7 @@ jobs: pnpm changeset version --snapshot next pnpm changeset publish --tag next env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.NPM_DEPLOY_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # ensure docs are always deployed after merge of changeset PR @@ -119,14 +120,15 @@ jobs: if: startsWith(env.LAST_COMMIT_MSG, 'ci(release):') && env.RELEASE_VERSION_HIGHER_THAN_LATEST == 'true' run: echo SHOULD_DEPLOY_DOCS=true >> $GITHUB_ENV - - name: Update docs (nightly) - if: github.ref_name == 'master' && env.SHOULD_DEPLOY_DOCS == 'true' - uses: benc-uk/workflow-dispatch@v1 - with: - workflow: update-nightly.yml - ref: master - repo: FuelLabs/docs-hub - token: ${{ secrets.GITHUB_TOKEN }} + # # Commenting out as we require permissions to trigger across repos + # - name: Update docs (nightly) + # if: github.ref_name == 'master' && env.SHOULD_DEPLOY_DOCS == 'true' + # uses: benc-uk/workflow-dispatch@v1 + # with: + # workflow: update-nightly.yml + # ref: master + # repo: FuelLabs/docs-hub + # token: ${{ secrets.GITHUB_TOKEN }} - name: Create PR to apply latest release to master if: steps.changesets.outputs.published == 'true' && startsWith(github.ref_name, 'release/') && env.RELEASE_VERSION_HIGHER_THAN_LATEST == 'true' @@ -178,10 +180,11 @@ jobs: env: S3_CDN_BUCKET: ${{ secrets.S3_CDN_BUCKET }} - - name: Notify migrations and disclosures of the new release (breaking changes) - run: | - curl -X POST \ - -H "Accept: application/vnd.github.v3+json" \ - -H "Authorization: token ${{ secrets.MIGRATIONS_RELEASE_TRIGGER_TOKEN }}" \ - https://api.github.com/repos/FuelLabs/migrations-and-disclosures/dispatches \ - -d '{"event_type":"update_versions"}' + # # Commenting out as we require permissions to trigger across repos + # - name: Notify migrations and disclosures of the new release (breaking changes) + # run: | + # curl -X POST \ + # -H "Accept: application/vnd.github.v3+json" \ + # -H "Authorization: token ${{ secrets.MIGRATIONS_RELEASE_TRIGGER_TOKEN }}" \ + # https://api.github.com/repos/FuelLabs/migrations-and-disclosures/dispatches \ + # -d '{"event_type":"update_versions"}'