Skip to content

Commit d18af60

Browse files
committed
Add GitHub Action to publish manual releases
Signed-off-by: John Rofrano <[email protected]>
1 parent 4bc7a3d commit d18af60

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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

0 commit comments

Comments
 (0)