Skip to content

Update Version

Update Version #116

Workflow file for this run

name: Update Version
permissions:
contents: write
on:
workflow_dispatch:
schedule:
- cron: "0 2 * * *" # Every day at 2AM
jobs:
update-versions:
name: Update versions.json
runs-on: ubuntu-latest
steps:
- uses: nixbuild/nix-quick-install-action@v22
- name: Get Latest Release
uses: octokit/[email protected]
id: get_latest_release
with:
route: GET /repos/{owner}/{repo}/releases/latest
owner: Exafunction
repo: codeium
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v3
- name: Update files
id: update
run: |
VERSION=${{ fromJSON(steps.get_latest_release.outputs.data).tag_name }}
VERSION=${VERSION#language-server-v}
curl -L "https://github.com/Exafunction/codeium/releases/download/language-server-v$VERSION/language_server_linux_x64" \
-o ./language_server
chmod +x ./language_server
STAMP=$(./language_server --stamp | sed -nr 's/STABLE_BUILD_SCM_REVISION: ([0-9a-fA-F]*)/\1/p')
LINUX_X64=$(nix-prefetch-url --type sha256 "https://github.com/Exafunction/codeium/releases/download/language-server-v$VERSION/language_server_linux_x64")
LINUX_ARM=$(nix-prefetch-url --type sha256 "https://github.com/Exafunction/codeium/releases/download/language-server-v$VERSION/language_server_linux_arm")
MACOS_X64=$(nix-prefetch-url --type sha256 "https://github.com/Exafunction/codeium/releases/download/language-server-v$VERSION/language_server_macos_x64")
MACOS_ARM=$(nix-prefetch-url --type sha256 "https://github.com/Exafunction/codeium/releases/download/language-server-v$VERSION/language_server_macos_arm")
jq \
--arg "VERSION" "$VERSION" --arg "STAMP" "$STAMP" \
--arg "LINUX_X64" "$LINUX_X64" --arg "LINUX_ARM" "$LINUX_ARM" \
--arg "MACOS_X64" "$MACOS_X64" --arg "MACOS_ARM" "$MACOS_ARM" \
'{
"version": $VERSION,
"stamp": $STAMP,
"hashes": {
"x86_64-linux": $LINUX_X64,
"aarch64-linux": $LINUX_ARM,
"x86_64-darwin": $MACOS_X64,
"aarch64-darwin": $MACOS_ARM
}
}' <<< "{}" | tee lua/codeium/versions.json | jq -C
if git diff --exit-code lua/codeium/versions.json > /dev/null; then
echo "changed=false" >> "$GITHUB_OUTPUT"
else
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
- name: Commit and push
if: steps.update.outputs.changed == 'true'
run: |
git add lua/codeium/versions.json
git config --global user.name "codeium.nvim [bot]"
git config --global user.email "[email protected]"
git commit -m "Update Codeium LSP to ${{ steps.update.outputs.version }}"
git push