Skip to content

ci: add ci workflow to manage lib release with semantic-release #80

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

Merged
merged 2 commits into from
Apr 26, 2024

Conversation

spulci
Copy link
Contributor

@spulci spulci commented Apr 25, 2024

This PR needs a few configs to be done on the base repository. These steps NEED to be done before merging!

Steps

1. Generate an API Key on your Pypi.org account; log to PyPi and go to account settings

immagine

2. Generate an environment on you Github repository. Call it "development":

immagine

and a secret called PYPI_TOKEN with the value of the generated token

immagine

3. Create a tag from main with the latest version published without this new feature.

E.g. if version was 2.6.0 tag name will be v2.6.0. Using the Github UI, you should create a new release on main with a new tag

immagine

4. Create a branch pre/beta from main and make it as protected branch.

immagine

To protect the branch you should add a protection rule:

immagine

4. Merge the PR and start using semantic commit messages

Understanding the workflow:

To develop a new feature or fix a bug

Create a child branch of pre/beta (eg: feat/x or fix/x or a name that you like). Do you development on this branch, create a pull request that will merge this branch intro pre/beta. Do your code review! Merge the PR: semantic will release a new version according to the LATEST commit message used and it will publish the lib on PyPi for you using a special "beta" label (Pypi use naming convention like b1, b2 etc for each beta release improvement leaving the version number untouched. This is due to the fact that your are working on a future version that is not yet ready to be released (so it's a beta1, beta2, beta3 etc). Please remember to use semantic commit message and BE SURE that the LAST COMMIT msg use release keywords like "fix:" or "feat:", otherwise no new release will be triggered but your commits will be just added to the changelog.md

To release a version to the public

You have to make the latest beta on pre/beta to be a stable version: make a pull request that merge pre/beta into main! Semantic will release a version of the library, just removing the beta-x extension.

To start a new development just after a release has been done on main

Are you ready to start developing a new future version? Make a Pull Request that merges main into pre/beta. Semantic will generate a new minor version with a new beta-1 label. Now update and switch to pre/beta and create a new child branch to start developing your new feature or fix.

Some links:

https://www.conventionalcommits.org/en/v1.0.0/
https://semantic-release.gitbook.io/semantic-release/recipes/release-workflow/pre-releases

@spulci spulci marked this pull request as ready for review April 26, 2024 13:39
@spulci spulci changed the base branch from main to pre/beta April 26, 2024 17:11
@VinciGit00 VinciGit00 merged commit 30e599d into ScrapeGraphAI:pre/beta Apr 26, 2024
Copy link

🎉 This PR is included in version 0.3.0-beta.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link

🎉 This PR is included in version 0.3.0 🎉

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