refactor: drop CLDK-side analysis cache, rely on codeanalyzer-python #21
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 uv 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 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 uv | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| enable-cache: true | |
| - name: Set up Python | |
| run: uv python install 3.11 | |
| - name: Install Python package dependencies | |
| run: uv sync --all-groups --frozen | |
| - name: Run Tests | |
| id: test | |
| continue-on-error: true | |
| run: uv 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: uv 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: uv publish --token ${{ secrets.PYPI_API_TOKEN }} |