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

cannot create release for python package #186

Open
builder555 opened this issue Jan 3, 2024 · 2 comments
Open

cannot create release for python package #186

builder555 opened this issue Jan 3, 2024 · 2 comments

Comments

@builder555
Copy link

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

@ahmadnassri
Copy link
Owner

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

@ahmadnassri
Copy link
Owner

ahmadnassri commented Jan 3, 2024

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

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

No branches or pull requests

2 participants