release #1
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: release | |
| on: | |
| schedule: | |
| - cron: '0 8 * * *' | |
| workflow_dispatch: | |
| inputs: | |
| JDT_LS_VERSION: | |
| description: 'The (optional) release version (including qualifier) of JDT-LS to use.' | |
| type: string | |
| publishPreRelease: | |
| description: 'Publish a pre-release ?' | |
| required: true | |
| type: choice | |
| options: | |
| - 'true' | |
| - 'false' | |
| default: 'true' | |
| publishToMarketPlace: | |
| description: 'Publish to VS Code Marketplace ?' | |
| required: true | |
| type: choice | |
| options: | |
| - 'true' | |
| - 'false' | |
| default: 'false' | |
| publishToOVSX: | |
| description: 'Publish to OpenVSX Registry ?' | |
| required: true | |
| type: choice | |
| options: | |
| - 'true' | |
| - 'false' | |
| default: 'false' | |
| jobs: | |
| should-build-change: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| repo-cache-hit: ${{ steps.cache-last-commit.outputs.cache-hit }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| repository: 'eclipse-jdtls/eclipse.jdt.ls' | |
| fetch-depth: 2 | |
| path: eclipse.jdt.ls | |
| - uses: actions/checkout@v5 | |
| with: | |
| repository: 'redhat-developer/vscode-java' | |
| fetch-depth: 2 | |
| path: vscode-java | |
| - run: | | |
| pushd eclipse.jdt.ls | |
| git rev-parse HEAD >> ../lastCommit | |
| popd | |
| pushd vscode-java | |
| git rev-parse HEAD >> ../lastCommit | |
| - name: Check New Changes | |
| id: cache-last-commit | |
| uses: actions/cache@v5 | |
| with: | |
| path: lastCommit | |
| key: lastCommit-${{ hashFiles('lastCommit') }} | |
| packaging-job: | |
| runs-on: ubuntu-latest | |
| needs: should-build-change | |
| if: ${{ needs.should-build-change.outputs.repo-cache-hit != 'true' || github.event_name != 'schedule' }} | |
| steps: | |
| - name: Checkout JDT-LS | |
| if: "${{ inputs.JDT_LS_VERSION == '' }}" | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: eclipse-jdtls/eclipse.jdt.ls | |
| - name: Cache Maven local repository | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| ~/.m2/repository | |
| ~/.m2/wrapper | |
| !~/.m2/repository/org/eclipse/jdt/ls | |
| key: maven-local-${{ hashFiles('**/pom.xml') }} | |
| - name: Set Up Java | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| - name: Check Out VS Code Java | |
| uses: actions/checkout@v5 | |
| - name: Set Up NodeJS | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version: '20' | |
| - name: Install NodeJS dependencies | |
| run: npm install -g typescript "@vscode/vsce" "ovsx" | |
| - name: Build vscode-java | |
| run: | | |
| npm install | |
| - name: Prepare Lombok Support | |
| if: false | |
| run: | | |
| npm run download-lombok | |
| - name: Prepare Pre-Release | |
| if: ${{ github.event_name == 'schedule' || inputs.publishPreRelease == 'true' }} | |
| run: | | |
| npm run prepare-pre-release | |
| echo "publishPreReleaseFlag=--pre-release" >> $GITHUB_ENV | |
| - name: Package vscode-java | |
| run: | | |
| platforms=("win32-x64" "linux-x64" "linux-arm64" "darwin-x64" "darwin-arm64") | |
| for platform in ${platforms[@]}; do | |
| vsce package ${{ env.publishPreReleaseFlag }} --target ${platform} -o java-${platform}-${{ env.EXT_VERSION }}-${GITHUB_RUN_NUMBER}.vsix | |
| done | |
| vsce package ${{ env.publishPreReleaseFlag }} -o vscode-java-${{ env.EXT_VERSION }}-${GITHUB_RUN_NUMBER}.vsix | |
| ls -lash *.vsix | |
| - name: Upload VSIX Artifacts | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: vscode-java | |
| path: | | |
| java-*-${{ env.EXT_VERSION }}-${{github.run_number}}.vsix | |
| vscode-java-${{ env.EXT_VERSION }}-${{github.run_number}}.vsix | |
| if-no-files-found: error | |
| - name: Publish to GH Release Tab | |
| if: ${{ inputs.publishToMarketPlace == 'true' && inputs.publishToOVSX == 'true' }} | |
| uses: "marvinpinto/action-automatic-releases@919008cf3f741b179569b7a6fb4d8860689ab7f0" | |
| with: | |
| repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
| automatic_release_tag: "v${{ env.EXT_VERSION }}" | |
| title: "${{ env.EXT_VERSION }}" | |
| draft: true | |
| files: | | |
| java-*-${{ env.EXT_VERSION }}-${{github.run_number}}.vsix | |
| vscode-java-${{ env.EXT_VERSION }}-${{ github.run_number }}.vsix | |
| release-job: | |
| environment: ${{ (inputs.publishToMarketPlace == 'true' || inputs.publishToOVSX == 'true') && 'release' || 'pre-release' }} | |
| runs-on: ubuntu-latest | |
| needs: packaging-job | |
| steps: | |
| - name: Set Up NodeJS | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version: '20' | |
| - name: Download VSIX & JDT-LS | |
| uses: actions/download-artifact@v5 | |
| - name: Display structure of downloaded files | |
| run: ls -R | |
| - name: Publish to VS Code Marketplace | |
| if: ${{ github.event_name == 'schedule' || inputs.publishToMarketPlace == 'true' || inputs.publishPreRelease == 'true' }} | |
| run: | | |
| for platformVsix in vscode-java/java-*-*-${GITHUB_RUN_NUMBER}.vsix; do | |
| ls ${platformVsix} | |
| done | |
| ls vscode-java/vscode-java-*-${GITHUB_RUN_NUMBER}.vsix | |
| - name: Delete saved artifact | |
| if: always() | |
| uses: geekyeggo/delete-artifact@e46cfb9575865f907c2beb2e4170b5f4c7d77c52 | |
| with: | |
| name: vscode-java |