-
Notifications
You must be signed in to change notification settings - Fork 682
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
semantic-release optims #1545
semantic-release optims #1545
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,42 +16,14 @@ jobs: | |
main: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
- name: Setup node | ||
uses: actions/setup-node@v3 | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
cache: 'yarn' | ||
- name: Install deps | ||
# this runs a build script so there is no dedicated build | ||
run: yarn install | ||
- name: Run storybook build script | ||
run: yarn build-storybook | ||
release: | ||
needs: main | ||
runs-on: ubuntu-latest | ||
if: ${{ github.repository == 'pmndrs/drei' && contains('refs/heads/master,refs/heads/beta,refs/heads/alpha',github.ref) && github.event_name == 'push' }} | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
- name: Setup node | ||
uses: actions/setup-node@v3 | ||
with: | ||
cache: 'yarn' | ||
- name: Install deps | ||
# this runs a build script so there is no dedicated build | ||
run: yarn install | ||
- name: 🚀 Release | ||
uses: cycjimmy/semantic-release-action@v3 | ||
with: | ||
extra_plugins: | | ||
@semantic-release/git | ||
branches: | | ||
[ | ||
'master', | ||
{name: 'beta', prerelease: true}, | ||
{name: 'alpha', prerelease: true} | ||
] | ||
Comment on lines
-44
to
-54
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've replaced this by local |
||
- run: yarn install | ||
- run: yarn build-storybook | ||
# semantic-release skips not configured branches(see: release.config.js) or pull-requests | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we can securely execute |
||
- run: yarn release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
@@ -1,4 +1,5 @@ | ||||
module.exports = { | ||||
branches: ['master', { name: 'alpha', prerelease: true }, { name: 'beta', prerelease: true }], | ||||
plugins: [ | ||||
'@semantic-release/commit-analyzer', | ||||
'@semantic-release/release-notes-generator', | ||||
|
@@ -9,12 +10,5 @@ module.exports = { | |||
}, | ||||
], | ||||
'@semantic-release/github', | ||||
[ | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we actually do not use that plugin, since we do not want package.json's version to be committed back into the repository: Line 3 in 290272d
because it is handled by semantic-release on its own: https://semantic-release.gitbook.io/semantic-release/support/faq#why-is-the-package.jsons-version-not-updated-in-my-repository and there is no need for |
||||
'@semantic-release/git', | ||||
{ | ||||
assets: ['package.json'], | ||||
message: 'chore(release): ${nextRelease.version}', | ||||
}, | ||||
], | ||||
], | ||||
} |
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.
there is actually no need to check:
contains('refs/heads/master,refs/heads/beta,refs/heads/alpha',github.ref)
because semantic-release won't release any branch that is not declared inrelease.config.js
.branches
github.event_name == 'push'
because semantic-release will always ignore PR: