-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(workflow): update artifacts workflow target
- Loading branch information
1 parent
4897a4f
commit 8a91ca5
Showing
3 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
name: update_server | ||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 0 1 * *' | ||
jobs: | ||
update-server: | ||
name: Update binaries | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Update artifacts | ||
env: | ||
GH_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
run: | | ||
make update | ||
- name: Commit changes | ||
env: | ||
COMMIT_MSG: | | ||
bump(version): Update server artifacts | ||
run: | | ||
git config user.email "actions@github" | ||
git config user.name "Github Actions" | ||
git add . | ||
git diff --quiet && git diff --staged --quiet || (git commit -m "${COMMIT_MSG}"; git push origin HEAD:${GITHUB_REF}) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.PHONY: generate | ||
update: | ||
./scripts/update.sh |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
echo "Verify gh version" | ||
gh --version | ||
|
||
release_tag=$(gh api "repos/eclipse-jdtls/eclipse.jdt.ls/tags" --jq '.[0].name') | ||
release_tag=$(echo "$release_tag" | sed 's/^v//') | ||
|
||
target_url="https://download.eclipse.org/jdtls/milestones/$release_tag" | ||
curl -L -o release.txt "$target_url/latest.txt" | ||
echo "Targeting $release_tag from eclipse-jdtls/eclipse.jdt.ls" | ||
|
||
artifact_name=$(cat release.txt) | ||
echo "Downloading $artifact_name from $target_url" | ||
curl -L -o server.tar.gz "$target_url/$artifact_name" | ||
rm -rf release.txt | ||
|
||
echo "Extracting server resource artifacts" | ||
rm -rf ./server && mkdir -p server | ||
tar -xvzf server.tar.gz -C ./server | ||
rm -rf server.tar.gz |