From e3fbd646180a9058e7ed7c1b4741ce25dc42c01b Mon Sep 17 00:00:00 2001 From: Tavian Taylor Date: Wed, 27 Aug 2025 10:39:07 +0100 Subject: [PATCH 1/2] chore(refactor) - refactor main.yml (#481) * refactor main.yaml * change empty string to null * update name * refactor: update condition * test change * update name --- .github/workflows/main.yml | 50 +++----------------------------------- 1 file changed, 4 insertions(+), 46 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2c41db03..4ed58abb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -64,8 +64,8 @@ jobs: name: playwright-test-results path: test-results/ release: - name: Release - if: github.ref == 'refs/heads/main' + name: Release (latest or beta) + if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta' needs: [lint, unit-test, e2e-test] runs-on: ubuntu-latest steps: @@ -88,6 +88,8 @@ jobs: publish: npm run release title: "chore(new-release)" commit: "chore(new-release)" + branch: ${{ github.ref == 'refs/heads/beta' && 'beta' || null }} + createGithubReleases: ${{ github.ref == 'refs/heads/main' }} env: GITHUB_TOKEN: ${{ secrets.STACKS_TOOLING_GH_RW_PAT }} NPM_TOKEN: ${{ secrets.NPM_API_KEY }} @@ -104,50 +106,6 @@ jobs: This is necessary because the PR is updated by github-actions[bot]. This is a technical user which does not trigger actions workflows on push events. See this GH issue for more details: https://github.com/changesets/action/issues/187 - release-beta: - name: Release Beta - if: github.ref == 'refs/heads/beta' - needs: [lint, unit-test, e2e-test] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v5 - - - name: Setup Node.js environment - uses: actions/setup-node@v4 - with: - node-version: lts/* - cache: "npm" - - - name: Install dependencies - run: npm ci - - - name: 🚀 Create/Update Release Pull Request or Publish to npm - id: changesets - uses: changesets/action@v1 - with: - version: npm run version - publish: npm run release - title: "chore(new-beta-release)" - commit: "chore(new-beta-release)" - branch: "beta" - createGithubReleases: false - env: - GITHUB_TOKEN: ${{ secrets.STACKS_TOOLING_GH_RW_PAT }} - NPM_TOKEN: ${{ secrets.NPM_API_KEY }} - - - name: Docs on Release Pull Request - # run only if there is a release pull request open - if: steps.changesets.outputs.pullRequestNumber - uses: thollander/actions-comment-pull-request@v3 - with: - comment-tag: "pr-release-docs" - pr-number: ${{ steps.changesets.outputs.pullRequestNumber }} - message: | - To trigger the build for this PR, **close and re-open it**. - This is necessary because the PR is updated by github-actions[bot]. - This is a technical user which does not trigger actions workflows on push events. - See this GH issue for more details: https://github.com/changesets/action/issues/187 - # cancel the jobs if another workflow is kicked off for the same branch concurrency: group: ${{ github.workflow }}-${{ github.ref }} From f95dc48eaf6aad022393ce169f9b84368d606a23 Mon Sep 17 00:00:00 2001 From: Tavian Taylor Date: Wed, 27 Aug 2025 11:01:14 +0100 Subject: [PATCH 2/2] create changeset --- .changeset/ripe-carpets-pull.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/ripe-carpets-pull.md diff --git a/.changeset/ripe-carpets-pull.md b/.changeset/ripe-carpets-pull.md new file mode 100644 index 00000000..97b6cdde --- /dev/null +++ b/.changeset/ripe-carpets-pull.md @@ -0,0 +1,5 @@ +--- +"@stackoverflow/stacks-editor": patch +--- + +update workflow file