This repository was archived by the owner on Nov 30, 2025. It is now read-only.
JDTLS Milestone Release Checker #187
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: JDTLS Milestone Release Checker | |
| on: | |
| schedule: | |
| # Runs daily at midnight UTC | |
| - cron: "0 0 * * *" | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| inputs: | |
| JDTLS_VERSION: | |
| description: "jdtls version" | |
| required: false | |
| FORCE_REPACKAGE: | |
| description: "Replace package already exists" | |
| required: true | |
| default: false | |
| type: boolean | |
| permissions: | |
| contents: write | |
| jobs: | |
| check-and-release: | |
| env: | |
| JDTLS_VERSION: ${{ github.event.inputs.JDTLS_VERSION }} | |
| FORCE_REPACKAGE: ${{ github.event.inputs.FORCE_REPACKAGE }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Set the latest jdtls version | |
| if: env.JDTLS_VERSION == '' | |
| run: | | |
| pip install requests | |
| echo "JDTLS_VERSION=$(python ./get_latest.py)" >> $GITHUB_ENV | |
| - name: Check if latest version has been released | |
| if: env.FORCE_REPACKAGE == 'false' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| echo "Fetching releases for repository..." | |
| releases=$(curl -H "Authorization: Bearer $GITHUB_TOKEN" \ | |
| -H "Accept: application/vnd.github.v3+json" \ | |
| https://api.github.com/repos/${{ github.repository }}/releases) | |
| if echo "$releases" | jq -e '.[] | select(.tag_name == "${{ env.JDTLS_VERSION }}")' > /dev/null; then | |
| echo "RELEASE_EXISTS=true" >> $GITHUB_ENV | |
| else | |
| echo "RELEASE_EXISTS=false" >> $GITHUB_ENV | |
| fi | |
| - name: Repackage jdtls | |
| if: env.RELEASE_EXISTS == 'false' || env.FORCE_REPACKAGE == 'true' | |
| run: | | |
| pip install requests | |
| python ./repackage.py | |
| ls | |
| - name: Debug | |
| run: | | |
| env | |
| - name: Release | |
| if: env.RELEASE_EXISTS == 'false' || env.FORCE_REPACKAGE == 'true' | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: jdtls.tar.gz | |
| make_latest: "${{ github.event_name == 'scheduled' && 'true' || 'false' }}" | |
| name: "${{env.JDTLS_VERSION}}" | |
| tag_name: "${{env.JDTLS_VERSION}}" |