Closed simonw closed 4 years ago
I think this needs if: secrets.PYPI_TOKEN
in the step.
This should be documented in the README.
You create PyPI tokens for publishing to a repo at https://pypi.org/manage/account/token/
Looks like you need to create a token with "Entire account (all projects)" permission in order to publish the original package. Then you can replace that token with one that just has scoped access to the package.
I created one of those and added it as the PYPI_TOKEN
secret to https://github.com/simonw/datasette-plugin-template-demo/settings/secrets
I'm going to try this action: https://github.com/actions/starter-workflows/blob/master/ci/python-publish.yml
Documented here: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries suggests
But I'm going to have it re-run the tests first.
I tried creating a new release in datasette-plugin-template-demo
and got this error:
https://github.com/simonw/datasette-plugin-template-demo/actions/runs/141395948
The workflow is not valid. .github/workflows/publish.yml (Line: 30, Col: 11): Unrecognized named-value: 'secrets'. Located at position 14 within expression: success() && secrets.PYPI_TOKEN
Referring to this line:
I'll try adding ${{ <context> }}
It worked! https://pypi.org/project/datasette-plugin-template-demo/0.1/
Just needs documentation now.
Originally posted by @simonw in https://github.com/simonw/datasette-plugin/issues/3#issuecomment-646893357