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