Skip to content

Commit

Permalink
chore: migrate release (#3642)
Browse files Browse the repository at this point in the history
* chore: add environment

* chore: comment out cross-repo requirements

* fix: correct env var name

---------

Co-authored-by: Mike Christopher <[email protected]>
Co-authored-by: Anderson Arboleya <[email protected]>
  • Loading branch information
3 people authored Jan 29, 2025
1 parent 45cc32e commit 18bdae8
Showing 1 changed file with 21 additions and 18 deletions.
39 changes: 21 additions & 18 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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'
Expand Down Expand Up @@ -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"}'

0 comments on commit 18bdae8

Please sign in to comment.