-
Notifications
You must be signed in to change notification settings - Fork 23
95 lines (78 loc) · 2.86 KB
/
release.yml
File metadata and controls
95 lines (78 loc) · 2.86 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Python Poetry Release
on:
push:
tags:
- "v*.*.*"
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Set up GraalVM CE Java 11
uses: graalvm/setup-graalvm@v1
with:
java-version: '21'
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
native-image-job-reports: 'true'
- name: Install jq
run: sudo apt-get update && sudo apt-get install -y jq
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "${HOME}/.local/bin" >> $GITHUB_PATH
export PATH="${HOME}/.local/bin:$PATH"
- name: Install Python package dependencies
run: |
poetry config virtualenvs.create false
poetry install --sync --no-interaction
- name: Run Tests
id: test
continue-on-error: true
run: poetry run make test
- name: Delete tag on failure
if: steps.test.conclusion == 'failure'
run: |
echo "Tests failed. Deleting tag ${GITHUB_REF#refs/tags/}..."
git push --delete origin ${GITHUB_REF#refs/tags/}
exit 1
- name: Inject the latest Code Analyzer JAR
run: |
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')
echo "Downloading: $CODE_ANALYZER_URL"
wget -q "$CODE_ANALYZER_URL"
mkdir -p ${{ github.workspace }}/cldk/analysis/java/codeanalyzer/jar/
mv codeanalyzer-*.jar ${{ github.workspace }}/cldk/analysis/java/codeanalyzer/jar/
- name: Build Package
run: poetry build
- name: Read Changelog Entry
id: changelog_reader
uses: mindsers/changelog-reader-action@v2
with:
validation_level: warn
version: ${{ steps.tag_name.outputs.current_version }}
path: ./CHANGELOG.md
- name: Build Changelog
id: gen_changelog
uses: mikepenz/release-changelog-builder-action@v5
with:
failOnError: "true"
configuration: .github/workflows/release_config.json
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish Release on GitHub
uses: softprops/action-gh-release@v1
with:
files: dist/*
body: ${{ steps.gen_changelog.outputs.changelog }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish package distributions to PyPI
run: poetry publish --username __token__ --password ${{ secrets.PYPI_API_TOKEN }}