-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: refactor release workflow #3678
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
880378b
to
22bcc4e
Compare
22bcc4e
to
e2167f2
Compare
# This is to avoid running the workflow when a release/* branch is created. | ||
if: | | ||
github.event.head_commit.message != 'ci(release): versioning packages and changesets' && | ||
github.event.before != '0000000000000000000000000000000000000000' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this if
statement, as well as the one in the release.yaml
file, in these workflows. I was specifically testing if the workflow will be started or not, and it works as is expected from the logic. If you want to test it yourself, you can create a new branch with a file with this workflow:
name: "You test"
on:
push:
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
changesets-pr:
runs-on: ubuntu-latest
permissions: write-all
if: |
github.event.head_commit.message != 'ci(release): versioning packages and changesets' &&
github.event.before != '0000000000000000000000000000000000000000'
steps:
- name: Bump and Collect Versions
run: echo ${{ toJson(github.event) }}
Commit the file and do the following steps:
git push --set-upstream origin your_branch_name
- the workflow won't run because ofgithub.event.before != '0000000000000000000000000000000000000000'
git commit --allow-empty -m "ci(release): versioning packages and changesets" && git push
- the workflow won't run because the commit message equals'ci(release): versioning packages and changesets'
git commit --allow-empty -m "whatever" && git push
- the workflow will run
The same holds for the release.yaml
workflow, just point 2 will succeed and point 3 will fail.
if: github.event.before != '0000000000000000000000000000000000000000' | ||
if: | | ||
github.event.head_commit.message == 'ci(release): versioning packages and changesets' && | ||
github.event.before != '0000000000000000000000000000000000000000' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now, because the workflow won't run at all except when the changesets PR gets merged, we won't be getting the manual approval requests in our notifications that were caused by environment: npm-deploy
.
Coverage Report:
Changed Files:Coverage values did not change👌. |
Summary
Note
Waiting for merge of #3639 to finalize this
This PR splits the release workflow into three workflows:
changesets-pr.yaml
, which creates/updates the changesets PR,release.yaml
, which publishes releases when the changesets PR is merged,publish-to-next.yaml
, which publishes to thenext
in our GitHub npm registry on every merge tomaster
Checklist