Use LLVM head for builds

clangd/actions/pick is currently broken because LLVM no longer has a
branch called master. We didn't have any releases for past 3 weeks, i've
contacted author in
https://github.com/ramasilveyra/last-successful-gh-commit/issues/2.
This commit is contained in:
Kadir Cetinkaya 2021-02-15 14:14:58 +01:00 committed by kadir çetinkaya
parent 405dee024a
commit 835256346b

View File

@ -21,17 +21,24 @@ jobs:
name: Create draft release
runs-on: ubuntu-latest
steps:
- name: Install deps
run: |
sudo apt-get install jq
- name: Clone scripts
uses: actions/checkout@v2
- name: Pick last successful commit
id: pick
uses: clangd/actions/.github/actions/pick@v0.1.0
with:
repo: llvm/llvm-project
token: ${{ secrets.GITHUB_TOKEN }}
# Use clangd/actions/pick after
# https://github.com/ramasilveyra/last-successful-gh-commit/issues/2 has
# been addressed.
- name: Get commit hash for LLVM head
run: >
curl --fail --show-error
"-HAuthorization: Bearer ${{ secrets.RELEASE_TOKEN }}"
"https://api.github.com/repos/llvm/llvm-project/commits/main" |
jq ".sha" -r > commit
- name: Compute release info
run: |
echo "RELEASE_COMMIT_SHORT=$(printf '%.12s' ${{ steps.pick.outputs.sha }})" >> $GITHUB_ENV
echo "RELEASE_COMMIT=$(cat commit)" >> $GITHUB_ENV
echo "RELEASE_COMMIT_SHORT=$(printf '%.12s' $(cat commit))" >> $GITHUB_ENV
echo "RELEASE_DATE=$(date -u +%Y%m%d)" >> $GITHUB_ENV
- name: Create release
uses: actions/create-release@master
@ -43,7 +50,7 @@ jobs:
body: |
Unstable snapshot of clangd on ${{ env.RELEASE_DATE }}.
Built from llvm/llvm-project@${{ steps.pick.outputs.sha }}.
Built from llvm/llvm-project@${{ env.RELEASE_COMMIT }}.
prerelease: true
# It would be nice to use draft releases, to hide them from users.
# But drafts don't fire events to trigger the autobuild workflow.