1313# See the License for the specific language governing permissions and
1414# limitations under the License.
1515
16+ version : 2.1
1617name : Deploy to PyPI
1718
1819on :
2829 PYTHON_VERSION : " 3.10"
2930 POETRY_VERSION : " 1.1.11"
3031
32+
3133jobs :
3234 release :
3335 # https://github.community/t/how-do-i-specify-job-dependency-running-in-another-workflow/16482
@@ -45,54 +47,34 @@ jobs:
4547 uses : actions/checkout@v3
4648 with :
4749 fetch-depth : 0 # action `relekang/python-semantic-release` requires all git history
50+
4851 - name : Setup python ${{ env.PYTHON_VERSION }}
4952 # see https://github.com/actions/setup-python
5053 uses : actions/setup-python@v4
5154 with :
5255 python-version : ${{ env.PYTHON_VERSION }}
53- - name : Setup poetry ${{ env.POETRY_VERSION }}
54- # see https://github.com/marketplace/actions/setup-poetry
55- uses : Gr1N/setup-poetry@v7
56+
57+ - name : Install and configure Poetry
58+ # See https://github.com/marketplace/actions/install-poetry-action
59+ uses : snok/install-poetry@v1
5660 with :
57- poetry-version : ${{ env.POETRY_VERSION }}
58- - name : pre-hook
59- id : before-release
60- run : |
61- VERSION="$(poetry version --short --no-interaction --no-ansi)"
62- # version may be empty at first
63- echo "::set-output name=version::$VERSION"
61+ version : ${{ env.POETRY_VERSION }}
62+ virtualenvs-create : true
63+ virtualenvs-in-project : true
64+ installer-parallel : true
65+
66+ - name : Install dependencies
67+ run : poetry install --no-root
68+
69+ - name : View poetry version
70+ run : poetry --version
71+
6472 - name : Python Semantic Release
65- id : semantic-release
6673 # see https://python-semantic-release.readthedocs.io/en/latest/automatic-releases/github-actions.html
6774 # see https://github.com/relekang/python-semantic-release
68- uses : relekang/python-semantic-release@v7.29.5
75+ uses : relekang/python-semantic-release@v7.31.2
6976 with :
7077 github_token : ${{ secrets.GITHUB_TOKEN }}
7178 repository_username : __token__
7279 repository_password : ${{ secrets.PYPI_TOKEN }}
73- pypi_token : ${{ secrets.PYPI_TOKEN }}
74- - name : post-hook
75- id : after-release
76- run : |
77- VERSION="$(poetry version --short --no-interaction --no-ansi)"
78- # version may still be empty
79- echo "::set-output name=version::$VERSION"
80- if [ "$VERSION" != "$VERSION_PRE" ]
81- then
82- echo "::set-output name=released::true"
83- fi
84- env :
85- VERSION_PRE : ${{ steps.before-release.outputs.version }}
86- - name : Artifact python dist
87- if : |
88- !failure() && !cancelled() &&
89- steps.after-release.outputs.released
90- # see https://github.com/actions/upload-artifact
91- uses : actions/upload-artifact@v3
92- with :
93- name : ${{ env.DIST_ARTIFACT }}
94- path : ${{ env.DIST_DIR }}/
95- if-no-files-found : error
96- # Dist results are required for further processing.
97- # Therefore, make sure that python-semantic-release is configuret to keep dist.
98- # see https://python-semantic-release.readthedocs.io/en/latest/configuration.html?highlight=remove_dist#remove-dist
80+ pypi_token : ${{ secrets.PYPI_TOKEN }}
0 commit comments