@@ -12,46 +12,55 @@ jobs:
12
12
release :
13
13
runs-on : ubuntu-latest
14
14
15
- env :
16
- JAVA_HOME : ${{ github.workspace }}/graalvm-ce-java11-22.3.3
17
-
18
15
steps :
19
16
- name : Check out code
20
17
uses : actions/checkout@v4
21
18
22
19
- name : Set up Python
23
- uses : actions/setup-python@v4
20
+ uses : actions/setup-python@v5
24
21
with :
25
22
python-version : ' 3.11'
26
23
27
- - name : Set up JDK 11 from GraalVM
28
- run : |
29
- echo "${{ env.JAVA_HOME }}/bin" >> $GITHUB_PATH
30
- wget https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.3.3/graalvm-ce-java11-linux-amd64-22.3.3.tar.gz
31
- tar -xvzf graalvm-ce-java11-linux-amd64-22.3.3.tar.gz
32
- ${{ env.JAVA_HOME }}/bin/gu install native-image
24
+ - name : Set up GraalVM CE Java 11
25
+ uses : graalvm/setup-graalvm@v1
26
+ with :
27
+ java-version : ' 11'
28
+ distribution : ' graalvm-community'
29
+ github-token : ${{ secrets.GITHUB_TOKEN }}
30
+
31
+ - name : Install jq
32
+ run : sudo apt-get update && sudo apt-get install -y jq
33
33
34
34
- name : Install Poetry
35
35
run : |
36
36
curl -sSL https://install.python-poetry.org | python3 -
37
37
echo "${HOME}/.local/bin" >> $GITHUB_PATH
38
+ export PATH="${HOME}/.local/bin:$PATH"
38
39
39
- - name : Configure Poetry
40
- run : poetry config virtualenvs.in-project true
41
-
42
- - name : Install Dependencies
43
- run : poetry install --no-root
40
+ - name : Install Python package dependencies
41
+ run : |
42
+ poetry config virtualenvs.create false
43
+ poetry install --sync --no-interaction
44
44
45
45
- name : Run Tests
46
- id : build
47
- continue-on-error : true # Allow workflow continuation on failure
46
+ id : test
47
+ continue-on-error : true
48
48
run : poetry run make test
49
49
50
50
- name : Delete tag on failure
51
- if : steps.build.outcome != 'success '
51
+ if : steps.test.conclusion == 'failure '
52
52
run : |
53
+ echo "Tests failed. Deleting tag ${GITHUB_REF#refs/tags/}..."
53
54
git push --delete origin ${GITHUB_REF#refs/tags/}
54
- exit 1 # Fail the workflow
55
+ exit 1
56
+
57
+ - name : Inject the latest Code Analyzer JAR
58
+ run : |
59
+ CODE_ANALYZER_URL=$(curl -s https://api.github.com/repos/codellm-devkit/codeanalyzer-java/releases/latest | jq -r '.assets[] | select(.name | endswith(".jar")) | .browser_download_url')
60
+ echo "Downloading: $CODE_ANALYZER_URL"
61
+ wget -q "$CODE_ANALYZER_URL"
62
+ mkdir -p ${{ github.workspace }}/cldk/analysis/java/codeanalyzer/jar/
63
+ mv codeanalyzer-*.jar ${{ github.workspace }}/cldk/analysis/java/codeanalyzer/jar/
55
64
56
65
- name : Build Package
57
66
run : poetry build
72
81
body : ${{ steps.gen_changelog.outputs.changelog }}
73
82
env :
74
83
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
84
+
85
+ - name : Publish package distributions to PyPI
86
+ run : poetry publish --username __token__ --password ${{ secrets.PYPI_API_TOKEN }}
0 commit comments