1
- name : ' PyPI Poetry Publish'
2
- description : ' Opinionated GitHub action to fully automate publishing packages to any PyPI registry - using Poetry and GitHub releases'
1
+ name : " PyPI Poetry Publish"
2
+ description : " Opinionated GitHub action to fully automate publishing packages to any PyPI registry - using Poetry and GitHub releases"
3
3
branding :
4
- icon : ' package'
5
- color : ' blue'
4
+ icon : " package"
5
+ color : " blue"
6
6
7
7
inputs :
8
8
ACCESS_TOKEN :
9
- description : ' Access Token for GitHub with write access on the repository'
9
+ description : " Access Token for GitHub with write access on the repository"
10
10
required : true
11
11
PYTHON_VERSION :
12
- description : ' Python Version'
12
+ description : " Python Version"
13
13
required : false
14
- default : ' 3.10'
14
+ default : " 3.10"
15
15
PACKAGE_DIRECTORY :
16
- description : ' Directory of the package'
16
+ description : " Directory of the package"
17
17
required : false
18
- default : ' ./ '
18
+ default : " ./ "
19
19
PUBLISH_REGISTRY_PASSWORD :
20
- description : ' Password for the user to publish to PyPI. May also be a Token - requires the `PUBLISH_REGISTRY_USERNAME` to be `__token__`'
20
+ description : " Password for the user to publish to PyPI. May also be a Token - requires the `PUBLISH_REGISTRY_USERNAME` to be `__token__`"
21
21
required : true
22
22
PUBLISH_REGISTRY_USERNAME :
23
- description : ' The username for the registry. Defaults to __token__'
23
+ description : " The username for the registry. Defaults to __token__"
24
24
required : false
25
- default : ' __token__'
25
+ default : " __token__"
26
26
POETRY_VERSION :
27
- description : ' The version of Poetry to use'
27
+ description : " The version of Poetry to use"
28
28
required : false
29
- default : ' '
29
+ default : " "
30
30
POETRY_CORE_VERSION :
31
- description : ' The version of Poetry Core to use'
31
+ description : " The version of Poetry Core to use"
32
32
required : false
33
- default : ' '
33
+ default : " "
34
34
BRANCH :
35
- description : ' Branch to publish from'
35
+ description : " Branch to publish from"
36
36
required : false
37
- default : ' master'
37
+ default : " master"
38
38
POETRY_DEPENDENCY_REGISTRY_URL :
39
- description : ' Allows to define a custom registry to be used by Poetry for dependency installation'
39
+ description : " Allows to define a custom registry to be used by Poetry for dependency installation"
40
40
required : false
41
41
POETRY_DEPENDENCY_REGISTRY_NAME :
42
- description : ' The name used for the custom registry in the dependencies'
42
+ description : " The name used for the custom registry in the dependencies"
43
43
required : false
44
44
POETRY_DEPENDENCY_REGISTRY_USERNAME :
45
- description : ' The username for the custom registry'
45
+ description : " The username for the custom registry"
46
46
required : false
47
47
POETRY_DEPENDENCY_REGISTRY_PASSWORD :
48
- description : ' The password for the custom registry'
48
+ description : " The password for the custom registry"
49
49
required : false
50
50
POETRY_DEPENDENCY_REGISTRY_AUTH :
51
- description : ' The authentication type for the custom registry'
51
+ description : " The authentication type for the custom registry"
52
52
required : false
53
- default : ' http-basic'
53
+ default : " http-basic"
54
54
PUBLISH_REGISTRY :
55
- description : ' The registry to publish to'
55
+ description : " The registry to publish to"
56
56
required : false
57
- default : ' https://upload.pypi.org/legacy/'
57
+ default : " https://upload.pypi.org/legacy/"
58
58
59
59
runs :
60
- using : ' composite'
60
+ using : composite
61
61
steps :
62
62
- name : Checkout Repository
63
63
uses : actions/checkout@v3
@@ -66,19 +66,19 @@ runs:
66
66
token : ${{ inputs.ACCESS_TOKEN }}
67
67
68
68
- name : Install poetry
69
- run : pip install poetry${{ inputs.POETRY_VERSION != '' && format('=={0}', inputs.POETRY_VERSION) || '' }} poetry-core${{ inputs.POETRY_CORE_VERSION != '' && format('=={0}', inputs.POETRY_CORE_VERSION) || '' }}
69
+ run : pip install poetry${{ inputs.POETRY_VERSION != '' && format('=={0}', inputs.POETRY_VERSION) || '' }} poetry-core${{ inputs.POETRY_CORE_VERSION != '' && format('=={0}', inputs.POETRY_CORE_VERSION) || '' }}
70
70
shell : bash
71
71
72
72
- name : Set up Python ${{ inputs.PYTHON_VERSION }}
73
73
uses : actions/setup-python@v4
74
74
with :
75
75
python-version : ${{ inputs.PYTHON_VERSION }}
76
- cache : ' poetry'
76
+ cache : poetry
77
77
check-latest : true
78
78
79
79
- name : Set GitHub Tag as Package Version
80
80
run : |
81
- echo __version__="'" ${{ github.event.release.tag_name }}"'" > ${{ inputs.PACKAGE_DIRECTORY }}__init__.py
81
+ sed -i -r 's/ __version__ *= *".*"/__version__ = " ${{ github.event.release.tag_name }}"/g' ${{ inputs.PACKAGE_DIRECTORY }}__init__.py
82
82
sed -i '0,/version =.*/s//version = "'"${{ github.event.release.tag_name }}"'"/' ./pyproject.toml
83
83
shell : bash
84
84
0 commit comments