pypa / readme_renderer

Safely render long_description/README files in Warehouse
Apache License 2.0
158 stars 88 forks source link

Build & release on tag #232

Closed di closed 2 years ago

di commented 2 years ago

We should set up a workflow for building & releasing this library on the creation of a new tag/release on GitHub, ideally using https://github.com/pypa/gh-action-pypi-publish.

miketheman commented 2 years ago

So this is interesting - it appears that there's already a release workflow based on the action: https://github.com/pypa/readme_renderer/blob/361f7fc598c9333f6ba3755e9f80e171d0bdce5a/.github/workflows/release.yml

It appears it was working up until release 33.0 - https://github.com/pypa/readme_renderer/actions/workflows/release.yml

Screen Shot 2022-03-18 at 6 36 26 PM

And from the logged output on 33 (34 is the same), the failure is:

File already exists. See https://pypi.org/help/#file-name-reuse for more information.

``` ... 2022-03-05T16:03:39.7388104Z Successfully built readme_renderer-33.0.tar.gz and readme_renderer-33.0-py3-none-any.whl 2022-03-05T16:03:39.7775184Z ##[group]Run pypa/gh-action-pypi-publish@release/v1 2022-03-05T16:03:39.7775857Z with: 2022-03-05T16:03:39.7778290Z password: *** 2022-03-05T16:03:39.7778641Z user: __token__ 2022-03-05T16:03:39.7778953Z packages_dir: dist 2022-03-05T16:03:39.7779218Z verify_metadata: true 2022-03-05T16:03:39.7779607Z skip_existing: false 2022-03-05T16:03:39.7779939Z verbose: false 2022-03-05T16:03:39.7780195Z print_hash: false 2022-03-05T16:03:39.7780532Z env: 2022-03-05T16:03:39.7780850Z pythonLocation: /opt/hostedtoolcache/Python/3.10.2/x64 2022-03-05T16:03:39.7781659Z LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.10.2/x64/lib 2022-03-05T16:03:39.7782505Z ##[endgroup] 2022-03-05T16:03:39.8110800Z ##[command]/usr/bin/docker run --name a95e02b06c26925248ceabbd456baff00ed9_887e0a --label 29a95e --workdir /github/workspace --rm -e pythonLocation -e LD_LIBRARY_PATH -e INPUT_PASSWORD -e INPUT_USER -e INPUT_REPOSITORY_URL -e INPUT_PACKAGES_DIR -e INPUT_VERIFY_METADATA -e INPUT_SKIP_EXISTING -e INPUT_VERBOSE -e INPUT_PRINT_HASH -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_RUN_ATTEMPT -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_REF_NAME -e GITHUB_REF_PROTECTED -e GITHUB_REF_TYPE -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e GITHUB_STEP_SUMMARY -e RUNNER_OS -e RUNNER_ARCH -e RUNNER_NAME -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/readme_renderer/readme_renderer":"/github/workspace" 29a95e:02b06c26925248ceabbd456baff00ed9 "__token__" "***" "" "dist" "true" "false" "false" "false" 2022-03-05T16:03:41.3416129Z Checking dist/readme_renderer-33.0-py3-none-any.whl: PASSED, with warnings 2022-03-05T16:03:41.3416914Z warning: `long_description_content_type` missing. defaulting to `text/x-rst`. 2022-03-05T16:03:41.3851241Z Checking dist/readme_renderer-33.0.tar.gz: PASSED, with warnings 2022-03-05T16:03:41.3852562Z warning: `long_description_content_type` missing. defaulting to `text/x-rst`. 2022-03-05T16:03:42.3361311Z Uploading distributions to https://upload.pypi.org/legacy/ 2022-03-05T16:03:42.3843932Z Uploading readme_renderer-33.0-py3-none-any.whl 2022-03-05T16:03:42.4235262Z 2022-03-05T16:03:42.5278426Z 0%| | 0.00/22.6k [00:00

So is this a matter of human workflow? @di are you uploading the built artifact, instead of letting GitHub Actions do it?

di commented 2 years ago

So is this a matter of human workflow? @di are you uploading the built artifact, instead of letting GitHub Actions do it?

🤦 yup.