softprops / action-gh-release

📦 :octocat: GitHub Action for creating GitHub Releases

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wheel filename one version back from the tag, how to fix?

mamullen13316 opened this issue · comments

I accidentally pushed a tag v0.1.3, but had forgotten to update the pyproject.toml version to 0.1.3 so the release version ended up correct but the filename was my_project-0.1.2-py3-none-any.whl. In an attempt to correct this, I deleted the release and the tag manually from Github, updated the pyproject.toml with the correct version v0.1.3 and merged it with a PR. Then pushed the v0.1.3 tag again. The release for v0.1.3 was created successfully, but the filename still has 0.1.2 in it. How can the version in the filename be corrected?

Here's the workflow:

name: Build and Release Python Wheel

on:
  push:
    tags:
      - 'v*'  # Trigger on tags that start with 'v'

jobs:
  build_and_release:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout Repository
        uses: actions/checkout@v2

      - name: Set up Python
        uses: actions/setup-python@v4
        with:
          python-version: 3.11

      - name: Install Dependencies
        run: |
          pip install poetry

      - name: Build Wheel
        run: |
          poetry build

      - name: Create Release and Upload Wheel
        id: create_release
        uses: softprops/action-gh-release@v1
        with:
          files: dist/*.whl
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Deleted the release and tag, then pushed the v0.1.3 tag again. This time it created the wheel with 0.1.3 in the filename. I did that at least 3 times yesterday. Best guess is that the wheel file with v0.1.2 was cached on the runner, and today I got a new runner.