Skip to content

Commit c6321cd

Browse files
committed
use date to make version unique for testpypi uploads
1 parent 88e2a34 commit c6321cd

File tree

1 file changed

+4
-24
lines changed

1 file changed

+4
-24
lines changed

.github/workflows/publish-testpypi.yml

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ jobs:
2323
run: |
2424
python -m pip install --upgrade pip
2525
pip install build
26+
- name: change mitiq version
27+
run: |
28+
truncate -s -1 VERSION.txt
29+
echo "$(date +"%Y%m%d")" >> VERSION.txt
2630
- name: Build mitiq
2731
run: python -m build
2832
- name: Store build artifacts
@@ -50,27 +54,3 @@ jobs:
5054
uses: pypa/gh-action-pypi-publish@release/v1
5155
with:
5256
repository-url: https://test.pypi.org/legacy/
53-
54-
verify-version:
55-
needs: test-publish
56-
runs-on: ubuntu-latest
57-
environment: testpypi
58-
steps:
59-
- name: Set up Python
60-
uses: actions/setup-python@v5
61-
with:
62-
python-version: "3.11"
63-
- name: Install package from TestPyPI
64-
run: pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.python.org/simple/ mitiq
65-
- name: Set version variable
66-
run: |
67-
VER=$(cat VERSION.txt)
68-
echo "VERSION=$VER" >> $GITHUB_ENV
69-
70-
- name: Verify the published version
71-
run: |
72-
TEST_IMPORT_VERSION=$(python -c "import mitiq; print(mitiq.__version__)")
73-
if [ "$TEST_IMPORT_VERSION" != "$VERSION" ]; then
74-
echo "Imported version $TEST_IMPORT_VERSION does not match tag $VERSION"
75-
exit 1
76-
fi

0 commit comments

Comments
 (0)