1- name : Python Poetry Release
1+ name : Python Poetry Release and Publish
22
33on :
44 push :
88permissions :
99 contents : write
1010
11+ env :
12+ PYPI_USERNAME : __token__
13+ PYPI_PASSWORD : ${{ secrets.PYPI_API_TOKEN }}
14+
1115jobs :
12- release :
16+ release-and-publish :
1317 runs-on : ubuntu-latest
1418
1519 env :
2024 uses : actions/checkout@v4
2125
2226 - name : Set up Python
23- uses : actions/setup-python@v4
27+ uses : actions/setup-python@v5
2428 with :
2529 python-version : ' 3.11'
2630
@@ -37,10 +41,12 @@ jobs:
3741 echo "${HOME}/.local/bin" >> $GITHUB_PATH
3842
3943 - name : Configure Poetry
40- run : poetry config virtualenvs.in-project true
44+ run : |
45+ poetry config virtualenvs.in-project true
46+ poetry config virtualenvs.create false
4147
4248 - name : Install Dependencies
43- run : poetry install --no-root
49+ run : poetry install --sync -- no-interaction
4450
4551 - name : Run Tests
4652 id : build
5359 git push --delete origin ${GITHUB_REF#refs/tags/}
5460 exit 1 # Fail the workflow
5561
62+ - name : Inject the latest Code Analyzer JAR
63+ run : |
64+ CODE_ANALYZER_URL=$(curl -s https://api.github.com/repos/IBM/codenet-minerva-code-analyzer/releases/latest | jq -r '.assets[] | .browser_download_url')
65+ echo "Downloading: " $CODE_ANALYZER_URL
66+ wget -q $CODE_ANALYZER_URL
67+ echo "Moving codeanalyzer jar to:" ${{ github.workspace }}/cldk/analysis/java/codeanalyzer/jar/
68+ mv codeanalyzer-*.jar ${{ github.workspace }}/cldk/analysis/java/codeanalyzer/jar/
69+
5670 - name : Build Package
5771 run : poetry build
5872
6680 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
6781
6882 - name : Publish Release on GitHub
83+ id : github_release
6984 uses : softprops/action-gh-release@v1
7085 with :
7186 files : dist/*
7287 body : ${{ steps.gen_changelog.outputs.changelog }}
7388 env :
7489 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
90+
91+ - name : Publish package distributions to PyPI
92+ run : poetry publish --username $PYPI_USERNAME --password $PYPI_PASSWORD
0 commit comments