88 branches :
99 - main
1010 workflow_dispatch :
11+ inputs :
12+ JDTLS_VERSION :
13+ description : " jdtls version"
14+ required : false
15+ FORCE_REPACKAGE :
16+ description : " Replace package already exists"
17+ required : true
18+ default : false
19+ type : boolean
1120
1221permissions :
1322 contents : write
1423
1524jobs :
1625 check-and-release :
26+ env :
27+ JDTLS_VERSION : ${{ github.event.inputs.JDTLS_VERSION }}
28+ FORCE_REPACKAGE : ${{ github.event.inputs.FORCE_REPACKAGE }}
1729 runs-on : ubuntu-latest
1830
1931 steps :
2032 - name : Checkout repository
2133 uses : actions/checkout@v3
2234
23- - name : Get latest jdtls version
24- id : get_latest
35+ - name : Set the latest jdtls version
36+ if : env.JDTLS_VERSION == ''
2537 run : |
2638 pip install requests
27- echo "latest_version =$(python ./get_latest.py)" >> $GITHUB_ENV
39+ echo "JDTLS_VERSION =$(python ./get_latest.py)" >> $GITHUB_ENV
2840
2941 - name : Check if latest version has been released
42+ if : env.FORCE_REPACKAGE == 'false'
3043 env :
3144 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
3245 run : |
@@ -35,24 +48,28 @@ jobs:
3548 -H "Accept: application/vnd.github.v3+json" \
3649 https://api.github.com/repos/${{ github.repository }}/releases)
3750
38- if echo "$releases" | jq -e '.[] | select(.tag_name == "${{ env.latest_version }}")' > /dev/null; then
39- echo "release_exists =true" >> $GITHUB_ENV
51+ if echo "$releases" | jq -e '.[] | select(.tag_name == "${{ env.JDTLS_VERSION }}")' > /dev/null; then
52+ echo "RELEASE_EXISTS =true" >> $GITHUB_ENV
4053 else
41- echo "release_exists =false" >> $GITHUB_ENV
54+ echo "RELEASE_EXISTS =false" >> $GITHUB_ENV
4255 fi
4356
4457 - name : Repackage jdtls
45- if : env.release_exists == 'false'
58+ if : env.RELEASE_EXISTS == 'false' || env.FORCE_REPACKAGE == 'true '
4659 run : |
4760 pip install requests
4861 python ./repackage.py
4962 ls
5063
64+ - name : Debug
65+ run : |
66+ env
67+
5168 - name : Release
52- if : env.release_exists == 'false'
69+ if : env.RELEASE_EXISTS == 'false' || env.FORCE_REPACKAGE == 'true '
5370 uses : softprops/action-gh-release@v2
5471 with :
5572 files : jdtls.tar.gz
56- make_latest : " true"
57- name : " ${{env.latest_version }}"
58- tag_name : " ${{env.latest_version }}"
73+ make_latest : " ${{ github.event_name == 'scheduled' && ' true' || 'false' }} "
74+ name : " ${{env.JDTLS_VERSION }}"
75+ tag_name : " ${{env.JDTLS_VERSION }}"
0 commit comments