Skip to content

Commit 1ecd682

Browse files
committed
fix: pypi publish workflow
1 parent c82229b commit 1ecd682

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

.github/workflows/main-pip.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,17 @@ jobs:
6565
# And only on a push event, not a pull_request.
6666
if: ${{ github.event_name == 'push' }}
6767
runs-on: ubuntu-latest
68+
permissions:
69+
id-token: write
6870
defaults:
6971
run:
7072
shell: bash -l {0}
7173
env:
7274
PKG_NAME: "activity-browser-dev25"
7375
steps:
76+
- uses: actions/checkout@v4
77+
with:
78+
fetch-depth: 0
7479
- name: Overwrite package name
7580
run: |
7681
sed -i "s/name = \"activity_browser\"/name=\"$PKG_NAME\"/" pyproject.toml
@@ -79,6 +84,7 @@ jobs:
7984
python -m pip install build --user
8085
- name: Build a binary wheel and a source tarball
8186
run: |
87+
export GIT_DESCRIBE_TAG=`git describe --tags`
8288
python -m build --outdir dist/ .
8389
- name: Publish distribution 📦 to Test PyPI
8490
uses: pypa/gh-action-pypi-publish@release/v1

setup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
version = os.environ["PKG_VERSION"]
99
else:
1010
version = os.environ.get("GIT_DESCRIBE_TAG", "0.0.0")
11+
if "-" in version:
12+
versions = version.split("-")
13+
version = "{}.post{}".format(versions[0], versions[1])
1114

1215
setup(
1316
version=version,

0 commit comments

Comments
 (0)