From 1423142d079492505c84b7306a3c469a092e2cc0 Mon Sep 17 00:00:00 2001 From: Jesse Bannon Date: Mon, 20 Feb 2023 19:46:51 -0800 Subject: [PATCH] [RELEASE] Fix commit count issue in release post (#460) --- .github/workflows/release.yaml | 15 ++++++++++----- Makefile | 1 + src/ytdl_sub/__init__.py | 4 ++-- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 7c3a06ea..7abac91e 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,10 +1,9 @@ -name: ytld-sub release +name: ytld-sub Release on: push: # publish only when pushed to master branches: - master - jobs: pypi-publish: name: pypi-publish @@ -15,6 +14,9 @@ jobs: steps: - uses: actions/checkout@v3 + with: + fetch-depth: 0 # Needed for correct commit count. TODO: define once using GH actions + ref: master - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v3 @@ -36,8 +38,10 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v3 + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + ref: master # Needed for correct commit count. TODO: define once using GH actions - name: Set version envs 1/3 run: | @@ -46,7 +50,7 @@ jobs: - name: Set version envs 2/3 run: | - echo "DATE_COMMIT_COUNT=$(git rev-list --count HEAD --since='${{ env.DATE }} 00:00:00')" >> $GITHUB_ENV + echo "DATE_COMMIT_COUNT=$(git rev-list --count master --since='${{ env.DATE }} 00:00:00')" >> $GITHUB_ENV - name: Set version envs 3/3 run: | @@ -64,6 +68,7 @@ jobs: echo "${{ env.LOCAL_VERSION }}" - name: Create Release + if: ${{ github.ref == 'refs/heads/master' }} id: create_release uses: softprops/action-gh-release@v1 with: diff --git a/Makefile b/Makefile index 18d08aab..3f7d1eaf 100644 --- a/Makefile +++ b/Makefile @@ -25,6 +25,7 @@ check_lint: && pydocstyle src/* wheel: clean $(shell echo "__pypi_version__ = \"$(PYPI_VERSION)\"\n__local_version__ = \"$(LOCAL_VERSION)\"" > src/ytdl_sub/__init__.py) + cat src/ytdl_sub/__init__.py pip3 install build python3 -m build docker_stage: wheel diff --git a/src/ytdl_sub/__init__.py b/src/ytdl_sub/__init__.py index 8c2cf3b8..a23675ef 100644 --- a/src/ytdl_sub/__init__.py +++ b/src/ytdl_sub/__init__.py @@ -1,2 +1,2 @@ -__pypi_version__ = "2023.02.20.post14" -__local_version__ = "2023.02.20+6896905" +__pypi_version__ = "2023.02.20.post12" +__local_version__ = "2023.02.20+5035825"