Skip to content

Commit d9ad150

Browse files
chore(ci) - update workflow file (#482)
* chore(refactor) - refactor main.yml (#481) * refactor main.yaml * change empty string to null * update name * refactor: update condition * test change * update name * create changeset
1 parent 976c0b9 commit d9ad150

File tree

2 files changed

+9
-46
lines changed

2 files changed

+9
-46
lines changed

.changeset/ripe-carpets-pull.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@stackoverflow/stacks-editor": patch
3+
---
4+
5+
update workflow file

.github/workflows/main.yml

Lines changed: 4 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ jobs:
6464
name: playwright-test-results
6565
path: test-results/
6666
release:
67-
name: Release
68-
if: github.ref == 'refs/heads/main'
67+
name: Release (latest or beta)
68+
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta'
6969
needs: [lint, unit-test, e2e-test]
7070
runs-on: ubuntu-latest
7171
steps:
@@ -88,6 +88,8 @@ jobs:
8888
publish: npm run release
8989
title: "chore(new-release)"
9090
commit: "chore(new-release)"
91+
branch: ${{ github.ref == 'refs/heads/beta' && 'beta' || null }}
92+
createGithubReleases: ${{ github.ref == 'refs/heads/main' }}
9193
env:
9294
GITHUB_TOKEN: ${{ secrets.STACKS_TOOLING_GH_RW_PAT }}
9395
NPM_TOKEN: ${{ secrets.NPM_API_KEY }}
@@ -104,50 +106,6 @@ jobs:
104106
This is necessary because the PR is updated by github-actions[bot].
105107
This is a technical user which does not trigger actions workflows on push events.
106108
See this GH issue for more details: https://github.com/changesets/action/issues/187
107-
release-beta:
108-
name: Release Beta
109-
if: github.ref == 'refs/heads/beta'
110-
needs: [lint, unit-test, e2e-test]
111-
runs-on: ubuntu-latest
112-
steps:
113-
- uses: actions/checkout@v5
114-
115-
- name: Setup Node.js environment
116-
uses: actions/setup-node@v4
117-
with:
118-
node-version: lts/*
119-
cache: "npm"
120-
121-
- name: Install dependencies
122-
run: npm ci
123-
124-
- name: 🚀 Create/Update Release Pull Request or Publish to npm
125-
id: changesets
126-
uses: changesets/action@v1
127-
with:
128-
version: npm run version
129-
publish: npm run release
130-
title: "chore(new-beta-release)"
131-
commit: "chore(new-beta-release)"
132-
branch: "beta"
133-
createGithubReleases: false
134-
env:
135-
GITHUB_TOKEN: ${{ secrets.STACKS_TOOLING_GH_RW_PAT }}
136-
NPM_TOKEN: ${{ secrets.NPM_API_KEY }}
137-
138-
- name: Docs on Release Pull Request
139-
# run only if there is a release pull request open
140-
if: steps.changesets.outputs.pullRequestNumber
141-
uses: thollander/actions-comment-pull-request@v3
142-
with:
143-
comment-tag: "pr-release-docs"
144-
pr-number: ${{ steps.changesets.outputs.pullRequestNumber }}
145-
message: |
146-
To trigger the build for this PR, **close and re-open it**.
147-
This is necessary because the PR is updated by github-actions[bot].
148-
This is a technical user which does not trigger actions workflows on push events.
149-
See this GH issue for more details: https://github.com/changesets/action/issues/187
150-
151109
# cancel the jobs if another workflow is kicked off for the same branch
152110
concurrency:
153111
group: ${{ github.workflow }}-${{ github.ref }}

0 commit comments

Comments
 (0)