1
- name : Python Poetry Release
1
+ name : Python Poetry Release and Publish
2
2
3
3
on :
4
4
push :
8
8
permissions :
9
9
contents : write
10
10
11
+ env :
12
+ PYPI_USERNAME : __token__
13
+ PYPI_PASSWORD : ${{ secrets.PYPI_API_TOKEN }}
14
+
11
15
jobs :
12
- release :
16
+ release-and-publish :
13
17
runs-on : ubuntu-latest
14
18
15
19
env :
20
24
uses : actions/checkout@v4
21
25
22
26
- name : Set up Python
23
- uses : actions/setup-python@v4
27
+ uses : actions/setup-python@v5
24
28
with :
25
29
python-version : ' 3.11'
26
30
@@ -37,10 +41,12 @@ jobs:
37
41
echo "${HOME}/.local/bin" >> $GITHUB_PATH
38
42
39
43
- 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
41
47
42
48
- name : Install Dependencies
43
- run : poetry install --no-root
49
+ run : poetry install --sync -- no-interaction
44
50
45
51
- name : Run Tests
46
52
id : build
53
59
git push --delete origin ${GITHUB_REF#refs/tags/}
54
60
exit 1 # Fail the workflow
55
61
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
+
56
70
- name : Build Package
57
71
run : poetry build
58
72
66
80
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
67
81
68
82
- name : Publish Release on GitHub
83
+ id : github_release
69
84
uses : softprops/action-gh-release@v1
70
85
with :
71
86
files : dist/*
72
87
body : ${{ steps.gen_changelog.outputs.changelog }}
73
88
env :
74
89
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