Prepare patch for release #15
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/}..." | 386F|
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: 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 }} |