Skip to content

Commit d195e00

Browse files
Update README.md
1 parent f625238 commit d195e00

File tree

1 file changed

+7
-17
lines changed

1 file changed

+7
-17
lines changed

README.md

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,12 @@ env:
3333
# Regex pattern used for extracting the version data from your fil
3434
# (usually, this does not need to be changed)
3535
REGEX_PATTERN: __version__\s*=\s*"(.*)"
36+
37+
# Python version used for building the package
38+
PYTHON_VERSION: '3.8'
3639
```
3740
38-
Replace the placeholder for the source file with the relative path to your Python file which contains the version information. Amend the RegEx, if necessary.
41+
Replace the placeholder for the source file with the relative path to your Python file which contains the version information. Amend the RegEx and the Python version, if necessary.
3942
4043
## Running the Github Action
4144
@@ -46,21 +49,8 @@ This Github action will do the following __whenever a new release is published__
4649
- Check if the Github ``ref_name`` is equal to the extracted version from you Python file. Abort job in case of a mismatch.
4750
- Build the PyPi package. Deploy it to PyPi Test and (if successful) PyPi Prod.
4851
49-
## Test your work flow
50-
51-
The PyPi Prod deployment branch comes with a built-in safeguard which prevents accidental deployments to PyPi Prod for cases where you want to do some testing. If you change the default for the Github Action trigger from
52-
53-
```yml
54-
on:
55-
release:
56-
types: [published]
57-
```
52+
This job will be triggered for releases AND prereleases in 'created' state (read: you tag a (pre)release in Github). Releases will be pushed to both PyPi Test and Prod whereas prereleases will only be pushed to PyPi Test.
5853
59-
to
60-
61-
```yml
62-
on:
63-
push:
64-
```
54+
## Test your work flow
6555
66-
then every change to your Github repo will trigger the Github Action but should not lead to a publication to PyPi Prod __unless you label the release__. When in doubt, you may also want to remove the ``PROD_PYPI_API_TOKEN``'s secret from your Github account to ensure that this workflow cannot write to PyPi Prod.
56+
In case you want to become acquainted with this work flow: The safest way to test the work flow is to create both Github secret entries ``TEST_PYPI_API_TOKEN`` and ``PROD_PYPI_API_TOKEN`` but assign an invalid token to them. When you run the workflow for a new 'master' branch prerelease, the job will try to push it to PyPi Test and will fail because of the invalid token.

0 commit comments

Comments
 (0)