2
2
3
3
## Requirements
4
4
```
5
+ pyenv virtualenv 3.10.13 markov-solver-dev
6
+ pyenv activate markov-solver-dev
5
7
pip install --upgrade pip
6
8
pip install -r requirements-dev.txt
7
9
```
@@ -23,28 +25,22 @@ python -m build
23
25
```
24
26
25
27
## Publish
26
- Publish to PyPi test repo at https://test.pypi.org/project/markov-solver
27
- ```
28
- python -m twine upload --repository testpypi dist/*
29
- ```
28
+ To publish a new release on PyPI, you need to create a new release on GitHub,
29
+ which in turns triggers a GitHub action to publish the release on PyPI.
30
30
31
- Publish to PyPi production repo at https://pypi.org/project/markov-solver
32
- ```
33
- python -m twine upload dist/*
34
- ```
31
+ To this aim, you first need to store the PyPI API Token as a secret on GitHub:
35
32
36
- ## Configure secrets
37
33
```
38
34
PYPI_API_TOKEN_BODY=$(cat resources/secrets/pypi-token.txt)
39
35
gh secret set "PYPI_API_TOKEN" \
40
36
--app "actions" \
41
37
--body "${PYPI_API_TOKEN_BODY}"
42
38
```
43
39
44
- ## Publish a new release
45
40
Create a draft release:
41
+
46
42
```
47
- VERSION="1.0.1 "
43
+ VERSION="1.0.0 "
48
44
gh release create v${VERSION} \
49
45
--title "markov-solver v$VERSION" \
50
46
--target mainline \
@@ -56,11 +52,25 @@ gh release create v${VERSION} \
56
52
Make changes to the release notes.
57
53
58
54
Publish the release:
55
+
59
56
```
60
57
gh release edit v${VERSION} --draft=false
61
58
```
62
59
63
- To delete a release from GitHub:
60
+ If you need to delete the release from GitHub:
61
+
64
62
```
65
63
gh release delete v${VERSION} --cleanup-tag --yes
64
+ ```
65
+
66
+ ### Manually publish to PyPI test
67
+ Publish to PyPi test repo at https://test.pypi.org/project/markov-solver
68
+ ```
69
+ python -m twine upload --repository testpypi dist/*
70
+ ```
71
+
72
+ ### Manually publish to PyPI prod
73
+ Publish to PyPi production repo at https://pypi.org/project/markov-solver
74
+ ```
75
+ python -m twine upload dist/*
66
76
```
0 commit comments