go-semantic-release / semantic-release

📦🚀 semantic-release written in Go
https://go-semantic-release.xyz
MIT License
404 stars 43 forks source link

Add python support #129

Open shaunc opened 2 years ago

shaunc commented 2 years ago

I'm wondering if I can use this for a python project on gitlab.

I like this project because of how lightweight it is, supports gitlab, and support pre-releases, which the current python-semantic-release doesn't (among a few other glitches I had using it). I've used the original semantic-release before, but AFAIK I'd have to use yarn/npm tooling in addition to poetry, which seems unnecessary if I can avoid it.

I suppose I would need to add pyproject.toml version support. The doc doesn't say anything about adding custom plugins. Does the .semrelrc support them? Any other thoughts?

christophwitzko commented 2 years ago

Hi @shaunc, at the moment we only have support for npm packages and helm charts. I am happy to add support for poetry. You can enable plugins using command line flags or the .semrelrc config file.

kiran94 commented 1 year ago

I wanted to share that I was able leverage this GitHub action + Poetry using what is already available. Here is what I have:

      - uses: actions/checkout@v3
      - uses: abatilo/actions-poetry@v2

      # Perform a Release (note the id being assigned below) 
      - name: Release
        id: release
        uses: go-semantic-release/action@v1
        if: github.ref == 'refs/heads/main'
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          allow-initial-development-versions: true

      # Bump Poetry Version with the output from the release step
      - name: Bump Poetry
        if: github.ref == 'refs/heads/main' && steps.release.outputs.version != ''
        run: poetry version ${{ steps.release.outputs.version }}

      # Commit the version bump back to main branch
      - uses: EndBug/add-and-commit@v9
        if: github.ref == 'refs/heads/main' && steps.release.outputs.version != ''
        with:
          message: "chore(version): bump"
          default_author: github_actions
          add: pyproject.toml

You can then ofcourse do a poetry publish if you need. Hope this helps!