ahmadnassri / action-semantic-release

Semantic Release with all the presets

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cannot create release for python package

builder555 opened this issue · comments

Steps to reproduce:

  1. Create a new repo
  2. Add example to .github/workflows/ci.yml:
    on:
      push:
        branches: [ master ]
    
    jobs:
      release:
        runs-on: ubuntu-latest
    
        steps:
          - name: checkout
            uses: actions/checkout@v4
    
          - name: semantic-release
            uses: ahmadnassri/action-semantic-release@v2
            env:
              GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  3. Set permissions on repo to allow R&W for actions
  4. Add a hello-world example in main.py
  5. commit & push

Expected results:

Created 0.1.0 release

Actual results:

Error: SemanticReleaseError: Missing package.json file

Other:

Since this is a python package, it shouldn't try to publish to NPM or search for package.json file.

https://github.com/builder555/blah/actions/runs/7396822456

by default semantic-release expects to publish an npm package, you'll have to create a configuration file and specify what "plugins" to use... see this own repo .release.json for an example

if you want the defaults without npm, this should suffice:

{
  "plugins": [
    "@semantic-release/commit-analyzer",
    "@semantic-release/release-notes-generator",
    "@semantic-release/github"
  ]
}

this will publish GitHub releases...

bonus: if you want to publish to pypi, you'd need to install this npm package then update the config accordingly: https://www.npmjs.com/package/semantic-release-pypi