File tree 2 files changed +59
-2
lines changed
2 files changed +59
-2
lines changed Original file line number Diff line number Diff line change 55
55
- name : Verify Test PyPI publication
56
56
run : |
57
57
sleep 60
58
- pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ uni2ts==${GITHUB_REF#refs/tags/v}
58
+ # Extract version from tag
59
+ VERSION=${GITHUB_REF#refs/tags/} # removes refs/tags/
60
+ echo "Installing version: $VERSION"
61
+ pip install --index-url https://test.pypi.org/simple/ uni2ts==${VERSION}
59
62
python -c "import uni2ts; print(uni2ts.__version__)"
60
63
61
64
publish-prod :
90
93
- name : Verify PyPI publication
91
94
run : |
92
95
sleep 60
93
- pip install uni2ts==${GITHUB_REF#refs/tags/v}
96
+ # Extract version from tag
97
+ VERSION=${GITHUB_REF#refs/tags/} # removes refs/tags/
98
+ echo "Installing version: $VERSION"
99
+ pip install uni2ts==$VERSION
94
100
python -c "import uni2ts; print(uni2ts.__version__)"
Original file line number Diff line number Diff line change
1
+ # This workflow will upload a Python Package using Twine to Test PyPi (Full release) when a workflow_dispatch event is triggered.
2
+
3
+ name : Manually Publish Package
4
+
5
+ on : workflow_dispatch
6
+
7
+ jobs :
8
+ publish :
9
+ runs-on : ubuntu-latest
10
+ steps :
11
+ - uses : actions/checkout@v4
12
+ with :
13
+ fetch-depth : 0
14
+
15
+ - name : Set up Python
16
+ uses : actions/setup-python@v5
17
+ with :
18
+ python-version : ' 3.10'
19
+
20
+ - name : Install tools
21
+ run : |
22
+ python -m pip install --upgrade pip
23
+ pip install hatch twine
24
+
25
+ - name : Build package
26
+ run : |
27
+ hatch build
28
+
29
+ - name : Run package validators
30
+ run : |
31
+ twine check dist/*
32
+
33
+ # Test install from wheel
34
+ pip install dist/*.whl
35
+ python -c "import uni2ts; print(uni2ts.__version__)"
36
+
37
+ - name : Upload to PyPI
38
+ env :
39
+ TWINE_USERNAME : __token__
40
+ TWINE_PASSWORD : ${{ secrets.PYPI_API_TOKEN }}
41
+ run : |
42
+ twine upload --verbose dist/*
43
+
44
+ - name : Verify PyPI publication
45
+ run : |
46
+ sleep 60
47
+ # Extract version from tag
48
+ VERSION=${GITHUB_REF#refs/tags/} # removes refs/tags/
49
+ echo "Installing version: $VERSION"
50
+ pip install uni2ts==$VERSION
51
+ python -c "import uni2ts; print(uni2ts.__version__)"
You can’t perform that action at this time.
0 commit comments