Skip to content

Gopls Update Checker #101

Gopls Update Checker

Gopls Update Checker #101

name: Gopls Update Checker
on:
schedule:
- cron: "0 0 */7 * *"
workflow_dispatch:
jobs:
compareTag:
runs-on: ubuntu-latest
outputs:
latest_tag: ${{ steps.tagCompare.outputs.LATEST_VERSION }}
requires_update: ${{ steps.tagCompare.outputs.REQUIRES_UPDATE }}
branch_name: ${{ steps.tagCompare.outputs.BRANCH_NAME }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- id: tagCompare
name: Run script
run: python3 ./scripts/compare_tags.py
updateVersion:
needs:
- compareTag
if: needs.compareTag.outputs.requires_update == 1
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v4
with:
go-version: "1.20"
check-latest: true
cache: true
- name: Install GOPLS
run: |
go install golang.org/x/tools/gopls@v${{ needs.compareTag.outputs.latest_tag }}
- uses: actions/setup-python@v4
- name: Update VERSION
run: |
echo "VERSION = '${{ needs.compareTag.outputs.latest_tag }}'" > plugin/version.py
- name: Update Schema and Settings
run: |
python ./scripts/update-schema-settings.py
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
commit-message: update to latest gopls version ${{ needs.compareTag.outputs.latest_tag }}
title: Update VERSION to Gopls v${{ needs.compareTag.outputs.latest_tag }}
labels: auto-update
body: |
Update VERSION to Gopls v${{ needs.compareTag.outputs.latest_tag }}
- [x] Updated `plugin/version.py`
- [x] Updated `schema` and `settings`
- [ ] Reviewed changes
branch: update/gopls_v${{ needs.compareTag.outputs.branch_name }}