Skip to content
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

Merged
merged 1 commit into from
Jul 2, 2023
Merged

semantic-release optims #1545

merged 1 commit into from
Jul 2, 2023

Conversation

abernier
Copy link
Member

@abernier abernier commented Jun 29, 2023

Why / What

  • using local devDependencies semantic-release package (rather than 3rd-party cycjimmy/semantic-release-action)
  • simplifying the workflow: only 1 job now

Checklist

  • Documentation updated (example)
  • Storybook entry added (example)
  • Ready to be merged

@vercel
Copy link

vercel bot commented Jun 29, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
drei ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 29, 2023 4:15pm

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jun 29, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit ae4179c:

Sandbox Source
runtime-fog-gqyp6v Configuration
Ground reflections and video textures Configuration
arc-x-pmndrs-colors Configuration

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' }}
Copy link
Member Author

@abernier abernier Jun 29, 2023

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 in release.config.js.branches
  • github.event_name == 'push' because semantic-release will always ignore PR:

    This run was triggered by a pull request and therefore a new version won't be published.

Comment on lines -44 to -54
- name: 🚀 Release
uses: cycjimmy/semantic-release-action@v3
with:
extra_plugins: |
@semantic-release/git
branches: |
[
'master',
{name: 'beta', prerelease: true},
{name: 'alpha', prerelease: true}
]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've replaced this by local semantic-release devDependencies package

@@ -9,12 +10,5 @@ module.exports = {
},
],
'@semantic-release/github',
[
Copy link
Member Author

@abernier abernier Jun 29, 2023

Choose a reason for hiding this comment

The 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:

"version": "0.0.0-semantic-release",

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

]
- run: yarn install
- run: yarn build-storybook
# semantic-release skips not configured branches(see: release.config.js) or pull-requests
Copy link
Member Author

@abernier abernier Jun 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can securely execute yarn release here, because semantic-release will not make a release for PRs or not configured pushed-branches: this simplifies the workflow a lot, and removes the whole release job, since it is now the same as the one for PRs

@abernier abernier marked this pull request as ready for review June 29, 2023 16:47
@drcmda drcmda merged commit 2fedb36 into master Jul 2, 2023
2 checks passed
@github-actions
Copy link

github-actions bot commented Jul 3, 2023

🎉 This PR is included in version 9.77.11-canary-branches.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@CodyJasonBennett CodyJasonBennett deleted the semantic-release-optims branch July 3, 2023 09:40
@github-actions
Copy link

github-actions bot commented Jul 3, 2023

🎉 This PR is included in version 9.77.11 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants