File tree Expand file tree Collapse file tree 1 file changed +50
-0
lines changed Expand file tree Collapse file tree 1 file changed +50
-0
lines changed Original file line number Diff line number Diff line change 1+ # This workflow will upload a Python Package to PyPi when a Release is created
2+ name : Publish Python Package
3+
4+ on :
5+ release :
6+ types : [published]
7+
8+ permissions :
9+ contents : read
10+
11+ env :
12+ PYPI_USERNAME : __token__
13+ PYPI_PASSWORD : ${{ secrets.PYPI_API_TOKEN }}
14+ CODE_ANALYZER_VERSION : " 20240923T182840"
15+
16+ jobs :
17+ publish :
18+ name : Publish
19+ runs-on : ubuntu-latest
20+
21+ steps :
22+ - name : Checkout the code
23+ uses : actions/checkout@v4
24+
25+ - name : Set up Python 3.11
26+ uses : actions/setup-python@v5
27+ with :
28+ python-version : " 3.11"
29+
30+ - name : Install Poetry
31+ run : |
32+ curl -sSL https://install.python-poetry.org | python - -y
33+ echo "$HOME/.local/bin" >> $GITHUB_PATH
34+
35+ - name : Install package dependencies
36+ run : |
37+ poetry config virtualenvs.create false
38+ poetry install --sync --no-interaction
39+
40+ - name : Get Code Analyzer
41+ run : |
42+ wget -q https://github.com/IBM/codenet-minerva-code-analyzer/releases/download/$CODE_ANALYZER_VERSION/codeanalyzer.jar
43+ echo "Moving codeanalyzer.jar to:" ${{ github.workspace }}/cldk/analysis/java/codeanalyzer/jar/codeanalyzer.jar
44+ mv codeanalyzer.jar ${{ github.workspace }}/cldk/analysis/java/codeanalyzer/jar/codeanalyzer.jar
45+
46+ - name : Build package
47+ run : poetry build
48+
49+ - name : Publish package distributions to PyPI
50+ run : poetry publish --username $PYPI_USERNAME --password $PYPI_PASSWORD
You can’t perform that action at this time.
0 commit comments