From 2a686311beee0e1bbdd676f8e8a9b62405ab5a3c Mon Sep 17 00:00:00 2001 From: Alex Freska Date: Thu, 19 Oct 2023 17:43:36 -0400 Subject: [PATCH] chore: update release step --- .github/workflows/release-main.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release-main.yml b/.github/workflows/release-main.yml index 75dcfbd60..844a75563 100644 --- a/.github/workflows/release-main.yml +++ b/.github/workflows/release-main.yml @@ -56,19 +56,25 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }} - # If there are changesets, then update the release pull request - - name: Update release pull request or release versions + # If there are changesets, then we are in PR prep mode and will + # update the release pull request. Note that there are no changesets + # this step will be skipped because no publish script is specified. + - name: Update release pull request id: changesets uses: changesets/action@v1 with: commit: 'chore: release packages' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Replace src code with dists for publishing run: ./scripts/replace-src-with-dists-for-publishing.sh - # If there are no changesets, then try to publish to NPM, - # if the latest versions are already published, may fail + # If no changesets were detected in the PR prep step then we are in + # release/publish mode. Check for and publish any new versions to NPM. - name: Publish to NPM if: steps.changesets.outputs.hasChangesets == 'false' - run: npm run release + uses: changesets/action@v1 + with: + publish: npm run release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }}