Compare commits

...

26 Commits

Author SHA1 Message Date
Younan Zhang
30a8f963f7
[CI] Rename debug symbol names to avoid tripping up the auto-installer (#2441)
The auto-install logic (in the https://github.com/clangd/node-clangd repo)
downloads the first package that starts with `clangd-<platform>-`.

The previous naming of the debug symbols package would mean it matched
this pattern, and it could be downloaded by the auto-install process instead
of the actual binary package.
2025-07-10 21:27:40 -04:00
Kevin
8f26871294
Update autobuild.yaml (#2440)
Fix Windows CI builds.
2025-07-07 18:45:19 +02:00
InfinityWei
1e95a5944b
Upgrade clang version from clang-9 to clang-10 in Linux workflow (#2416)
Fixes https://github.com/clangd/clangd/issues/2415
2025-06-22 03:01:57 -04:00
InfinityWei
439b0626d1
Fix MacOS CI builds (#2354) 2025-04-02 02:18:35 -04:00
Kevin
cb1cfd5a92
Fix Linux CI builds (#2319)
- Use container: ubuntu:20.04 instead of container: ubuntu:18.04.
- Add `exp` to `lib_compat.h` to solve the GLIBC 2.29 dependency issue.

Fixes https://github.com/clangd/clangd/issues/2244
2025-02-09 02:05:11 -05:00
Nathan Ridge
8ea4a27f46
Use upload-artifact@v4 and download-artifact@v4 (#2306)
Fixes https://github.com/clangd/clangd/issues/2305
2025-01-31 02:24:44 -05:00
Nathan Ridge
0a7499759d
Use macos-13 image for Mac builds (#2304) 2025-01-30 10:05:47 -05:00
Younan Zhang
909659b1ba
Build PDB file for Windows (#1678)
This allows dumping human-readable backtrace symbols with line numbers.

Also limit the maximum link jobs to 1 to avoid OOM in CI.
2024-12-01 20:24:14 -05:00
InfinityWei
cb870db274
Bump upload-artifact and download-artifact version to v3 (#2141)
v1 and v2 have been deprecated and workflows that try to use them now fail
2024-09-13 00:53:36 -04:00
InfinityWei
ff6fd49148
Fix weekly snapshot releases (#2084)
The release was broken because the macos-latest image was upgraded from macos-12 to macos-14, resulting in AppleClang being updated from version 14 to 15. To resolve the problem, modify macos-latest back to macos-12.

Additionally, the Linux build now needs Python 3.8, and the ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION environment variable enabled to keep using node 16.

Fixes #2028
2024-07-08 03:42:32 -04:00
ceron257
d5998e7fce Fixes #1793 - Fix runtime linkage 2023-11-17 13:29:30 +01:00
Kadir Cetinkaya
6e7f5968ba Use ubuntu-18.04 container to build linux binaries
Github action runners no longer support ubuntu-18.04 hosts and starting
with ubuntu-20.04 our binaries depend on glibc2.30, which is quite
recent. We're switching to building on ubuntu-18.04 containers instead
to not increase requirements.
2023-04-14 18:34:25 +02:00
Sam McCall
a729875fb1
Disable zstd (we don't use it)
This was leading to "library not loaded" errors on macs with no zstd
2022-09-15 20:06:18 +02:00
Kadir Cetinkaya
1a90fba271 Use windows-2019 explicitly in CI 2022-02-21 16:03:58 +01:00
Kadir Cetinkaya
f707dfdeab Use bash shell in Install OpenMP task and don't let copy fail 2022-01-21 09:45:27 +01:00
Kadir Cetinkaya
ebce136114 Fix windows snapshot builds 2022-01-17 14:05:27 +01:00
Kirill Bobyrev
64ccc9d3ec
Rename config.yaml to config.yml
.yaml extension does not seem to work. Context:
ca00967a89
2022-01-03 19:22:56 +01:00
Sam McCall
19a7bfdb2d Oops, fix path to OpenMP headers. 2022-01-03 18:30:19 +01:00
Sam McCall
9d058532be Include omp{,-tools}.h in the releases
This is really ugly, but AFAICT:
 - omp.h is not a "builtin clang header" in the usual sense, but when
   openmp is built it installs to clang's resource dir to be "always
   available"
 - this makes it into clang packages, e.g. debian's libclang-common-11-dev.
 - as a result, if we don't ship it, then <omp.h> can be found by system
   clang but not by us.
2022-01-03 18:30:19 +01:00
Kirill Bobyrev
ca00967a89
Link to GitHub Discussions when opening an issue (#975)
That will increase the visibility of the Discussions mechanism.
2022-01-03 17:59:22 +01:00
Kadir Cetinkaya
1a5759b2da Explicitly set OSX_DEPLOYMENT_TARGET in cmake flags, as
matrix.config.env is not propagated into job's env variables.
2021-11-04 11:37:08 +01:00
Kirill Bobyrev
c0845399c6
Merge periodic workflow into autobuild (#786)
The only reason to have a separate periodic action was the ability to
run the action "manually" by creating an appropriate release. With the
workflow_dispatch, we can actually trigger the workflow manually with
a convenient UI. Hence, periodic is no longer needed.
2021-08-04 16:04:55 +03:00
Kirill Bobyrev
c576bf40d1
NFC: Improve Bug Report issue template
Since this is a Markdown file, line breaks are needed for proper formatting. Otherwise, Preview joins lines that were not supposed to be together.
2021-07-29 14:26:58 +03:00
Kadir Cetinkaya
e2345b0261 Build fat binaries for mac 2021-07-09 10:12:57 +02:00
Kirill Bobyrev
186c1cfe5b
Bump gRPC version: 1.33.2 -> 1.36.3 (#783)
Builds started to fail
(https://github.com/clangd/clangd/runs/2595990099?check_suite_focus=true)
because Abseil source file (built as a part of gRPC) was using
`std::numeric_limits` and `uint32_t` but not including `<limits>` and
`<cstdint>` directly
(df3ea785d8/absl/synchronization/internal/graphcycles.cc).

This worked with libstdc++ 10 but GitHub Actions recently updated the
toolchain for Ubuntu 18.04 LTS we're using
(0409144182 (diff-8d528b68ca937dfe5a0194829f0eb2633bc3d7a3105a637ccb534a4da765f7a3R17)).
libstdc++ 11 changed the standard headers and is now less forgiving when
it comes to `<limits>` and few other headers not being included directly
(https://gcc.gnu.org/gcc-11/porting_to.html#:~:text=%3Climits%3E%20%28for%20std%3A%3Anumeric_limits%29).

This patch increases the gRPC version we use to fix the CI. Another
viable solution is "downgrading" back to libstdc++10 (e.g. via `sudo
apt-get remove -y libgcc-11-dev`).

This also requires changes in
https://github.com/llvm/llvm-zorg/blob/master/buildbot/google/docker/buildbot-clangd-ubuntu-clang/Dockerfile
for consistency.
2021-06-07 15:30:56 +03:00
Kirill Bobyrev
c4786ebf83 Revert "Downgrade to libgcc10"
This reverts commit 608aa9953c in favor of
https://github.com/clangd/clangd/pull/783
2021-06-07 14:29:21 +02:00
5 changed files with 232 additions and 107 deletions

View File

@ -13,11 +13,18 @@ For hints on what information is helpful, see: https://clangd.llvm.org/troublesh
If you can, provide a minimal chunk of code that shows the problem (either inline, or attach it if larger).
**Logs**
Please attach the clangd stderr log if you can. (Usually available from the editor)
If possible, run with `--log=verbose` - note that the logs will include the contents of open files!
If this is a crash, try to put `llvm-symbolizer` on your PATH per the troubleshooting instructions.
(If you're using Windows, place the associated PDB file (debug symbols) in the same directory as
clangd.exe and rerun again. For official releases, download symbols from the
[release page](https://github.com/clangd/clangd/releases).)
**System information**
Output of `clangd --version`:
Editor/LSP plugin:
Operating system:

4
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@ -0,0 +1,4 @@
contact_links:
- name: Questions and discussions
url: https://github.com/clangd/clangd/discussions
about: Usage questions, ideas and proposals

View File

@ -1,77 +1,195 @@
# Workflow to build binaries for a release.
# Triggered by release creation, which should include `llvm-project@<full-sha>`.
# Workflow to build binaries and release them.
# Triggered by the schedule or manual dispatch, which might include
# `<owner/llvm-project>@<full-sha>`.
#
# Because the build takes more than an hour, our GITHUB_TOKEN credentials may
# expire. A token `secrets.RELEASE_TOKEN` must exist with public_repo scope.
name: Build release binaries
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
on:
release:
types: created
# Run weekly on sunday at 21:37 UTC (arbitrary)
schedule:
- cron: '37 21 * * SUN'
workflow_dispatch:
inputs:
commit:
description: 'Commit to build from'
required: true
repo:
description: 'Repository to build from'
required: true
default: 'llvm/llvm-project'
release_name:
description: 'Release name'
required: true
tag:
description: 'Tag name'
required: true
description:
description: 'Release description'
required: true
jobs:
prepare:
schedule_environment:
name: Create default build environment
runs-on: ubuntu-latest
if: ${{ github.event_name == 'schedule' }}
steps:
- name: Find LLVM commit
- name: Install deps
run: |
perl -ne 'print "LLVM_REPO=$1\nLLVM_COMMIT=$2\n" if /(\w+\/llvm-project)@([[:xdigit:]]{40,})/' > commit.env <<EOF
${{ github.event.release.body }}
EOF
- name: Check LLVM commit was founud
run: grep LLVM_REPO commit.env
- name: Mark as draft
sudo apt-get install jq
- name: Clone scripts
uses: actions/checkout@v2
# Choose the commit to build a release from.
#
# We want to avoid unbuildable revisions: choose the last green from CI.
# FIXME: The criteria should be some consistent set of buildbots passing.
# 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 -XPATCH
"-HAuthorization: Bearer ${{ secrets.RELEASE_TOKEN }}"
"https://api.github.com/repos/${{ github.repository }}/releases/${{ github.event.release.id }}"
"-d" '{"draft": true}'
- name: Persist release info
uses: actions/upload-artifact@v1
COMMIT=$(curl --fail --show-error
"https://api.github.com/repos/llvm/llvm-project/commits/main" |
jq ".sha" -r)
echo "LLVM_COMMIT=$COMMIT" >> $GITHUB_ENV
- name: Compute release info
run: |
echo "RELEASE_COMMIT_SHORT=$(printf '%.12s' ${{ env.LLVM_COMMIT }})" >> $GITHUB_ENV
echo "RELEASE_DATE=$(date -u +%Y%m%d)" >> $GITHUB_ENV
echo "LLVM_REPO=llvm/llvm-project" >> commit.env
echo "LLVM_COMMIT=${{ env.LLVM_COMMIT }}" >> commit.env
- name: Use date as the tag name
run: >
echo "TAG_NAME=snapshot_${{ env.RELEASE_DATE }}" >> commit.env
- name: Use date and release commit as release name
run: >
echo "RELEASE_NAME=${{ env.RELEASE_DATE }} @${{ env.RELEASE_COMMIT_SHORT }}" >> commit.env
- name: Generate default release description
run: >
echo "RELEASE_DESCRIPTION=Unstable snapshot of clangd on ${{ env.RELEASE_DATE }}." >> commit.env
- name: Upload result
uses: actions/upload-artifact@v4
with:
name: env
path: commit.env
workflow_dispatch_environment:
name: Use inputs to create build environment
runs-on: ubuntu-latest
if: ${{ github.event_name == 'workflow_dispatch' }}
steps:
- name: Use repo and commit from the inputs
run: |
echo "LLVM_REPO=${{ github.event.inputs.repo }}" >> commit.env
echo "LLVM_COMMIT=${{ github.event.inputs.commit }}" >> commit.env
echo "TAG_NAME=${{ github.event.inputs.tag }}" >> commit.env
echo "RELEASE_NAME=${{ github.event.inputs.release_name }}" >> commit.env
echo "RELEASE_DESCRIPTION=${{ github.event.inputs.description }}" >> commit.env
- name: Upload result
uses: actions/upload-artifact@v4
with:
name: env
path: commit.env
create_release:
name: Create release
runs-on: ubuntu-latest
needs: [schedule_environment, workflow_dispatch_environment]
# Use always() and manually check results here since GitHub Actions do not
# support conditionally skipping jobs and there is no way to "exit with
# success" from a job.
if: always() && (needs.schedule_environment.result == 'success' || needs.workflow_dispatch_environment.result == 'success')
steps:
- name: Fetch environment variables
uses: actions/download-artifact@v4
with:
name:
env
path:
env
- name: Set environment variables
run: |
cat env/commit.env >> $GITHUB_ENV
- name: Create release
uses: actions/create-release@master
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.TAG_NAME }}
release_name: ${{ env.RELEASE_NAME }}
body: |
${{ env.RELEASE_DESCRIPTION }}
Built from ${{ env.LLVM_REPO }}@${{ env.LLVM_COMMIT }}.
prerelease: true
draft: true
- name: Preserve release info
run: |
echo "UPLOAD_URL=${{ steps.create_release.outputs.upload_url }}" >> release.env
echo "TAG_NAME=${{ env.TAG_NAME }}" >> release.env
echo "RELEASE_ID=${{ steps.create_release.outputs.id }}" >> release.env
- name: Upload result
uses: actions/upload-artifact@v4
with:
name: release
path: commit.env
path: release.env
# Build clangd using CMake/Ninja.
#
# This step is a template that runs on each OS, build config varies slightly.
# Uploading releases needs a per-job token that expires after an hour.
build:
name: Build ${{ matrix.config.name }}
needs: prepare
runs-on: ${{ matrix.config.os }}
needs: create_release
if: always() && needs.create_release.result == 'success'
strategy:
fail-fast: false
matrix:
config:
- name: windows
os: windows-latest
os: windows-2022
preinstall: choco install ninja nasm
vcvars: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat
vcvars: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat
cflags: /O2 /DNDEBUG
cmake: >-
"-DCMAKE_C_COMPILER=cl"
"-DCMAKE_CXX_COMPILER=cl"
"-DLLVM_ENABLE_ZLIB=OFF"
"-DLLVM_USE_CRT_RELEASE=MT"
"-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded"
"-DLLVM_ENABLE_PDB=ON"
"-DLLVM_PARALLEL_LINK_JOBS=1"
grpc_cmake: >-
"-DgRPC_MSVC_STATIC_RUNTIME=ON"
binary_extension: ".exe"
- name: mac
os: macos-latest
os: macos-13
preinstall: brew install ninja zlib p7zip
cflags: -O3 -gline-tables-only -DNDEBUG
env: MACOSX_DEPLOYMENT_TARGET=10.9
cmake: >-
"-DCMAKE_C_COMPILER=clang"
"-DCMAKE_CXX_COMPILER=clang++"
"-DLLVM_ENABLE_ZLIB=FORCE_ON"
"-DCMAKE_OSX_ARCHITECTURES=x86_64;arm64"
"-DCMAKE_OSX_DEPLOYMENT_TARGET=10.13"
# BoringSSL doesn't support universal binaries when building with ASM.
grpc_cmake: >-
"-DOPENSSL_NO_ASM=ON"
- name: linux
os: ubuntu-18.04
preinstall: >
sudo apt-get install ninja-build libz-dev libc-ares-dev &&
sudo apt-get remove -y libgcc-11-dev
os: ubuntu-latest
container: ubuntu:20.04
preinstall: >-
apt-get update &&
apt-get install -y ninja-build libz-dev libc-ares-dev wget clang-10
software-properties-common p7zip-full curl &&
add-apt-repository ppa:git-core/ppa &&
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | apt-key add - &&
apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main' &&
apt-get update &&
apt-get install -y git cmake python3.8 python3.8-dev
cflags: -O3 -gline-tables-only -DNDEBUG -include $GITHUB_WORKSPACE/.github/workflows/lib_compat.h
cmake: >-
"-DCMAKE_C_COMPILER=clang"
"-DCMAKE_CXX_COMPILER=clang++"
"-DCMAKE_C_COMPILER=clang-10"
"-DCMAKE_CXX_COMPILER=clang++-10"
"-DCMAKE_EXE_LINKER_FLAGS_RELEASE=-static-libgcc -Wl,--compress-debug-sections=zlib"
"-DLLVM_STATIC_LINK_CXX_STDLIB=ON"
"-DLLVM_ENABLE_ZLIB=FORCE_ON"
@ -80,6 +198,8 @@ jobs:
# libraries. All other gRPC dependencies can be built from sources.
grpc_cmake: >-
"-DgRPC_CARES_PROVIDER=package"
runs-on: ${{ matrix.config.os }}
container: ${{ matrix.config.container }}
steps:
- name: Clone scripts
uses: actions/checkout@v2
@ -106,8 +226,8 @@ jobs:
path: grpc
# We use the same version of gRPC for LLVM's clangd-ubuntu-tsan
# buildbot.
# https://github.com/llvm/llvm-zorg/blob/master/buildbot/google/docker/buildbot-clangd-ubuntu-clang/Dockerfile
ref: v1.33.2
# https://github.com/llvm/llvm-zorg/blob/main/buildbot/google/docker/buildbot-clangd-ubuntu-clang/Dockerfile
ref: v1.36.3
submodules: recursive
- name: Build gRPC
run: >
@ -125,12 +245,30 @@ jobs:
ninja -C grpc-build install
- name: Fetch target commit
uses: actions/download-artifact@v1
with: { name: release }
- name: Set target commit
uses: actions/download-artifact@v4
with:
name:
env
path:
env
- name: Fetch release info
uses: actions/download-artifact@v4
with:
name:
release
path:
release
- name: Put release info into env
run: |
cat release/commit.env >> $GITHUB_ENV
echo "CLANGD_DIR=clangd_${{ github.event.release.tag_name }}" >> $GITHUB_ENV
cat env/commit.env >> $GITHUB_ENV
cat release/release.env >> $GITHUB_ENV
shell: bash
# Use environment variables set above to create a directory. This needs
# to be a separate step because they are not in the context yet when
# being set.
- name: Set build directory
run: |
echo "CLANGD_DIR=clangd_${{ env.TAG_NAME }}" >> $GITHUB_ENV
shell: bash
- name: Clone LLVM
uses: actions/checkout@v2
@ -145,7 +283,7 @@ jobs:
cp llvm-project/llvm/LICENSE.TXT ${{ env.CLANGD_DIR }}
cmake -G Ninja -S llvm-project/llvm -B ${{ env.CLANGD_DIR }}
"-DLLVM_ENABLE_PROJECTS=clang;clang-tools-extra"
"-DLLVM_ENABLE_PROJECTS=clang;clang-tools-extra;openmp"
"-DLLVM_ENABLE_ASSERTIONS=OFF"
"-DLLVM_ENABLE_BACKTRACES=ON"
"-DLLVM_ENABLE_TERMINFO=OFF"
@ -155,18 +293,30 @@ jobs:
"-DCMAKE_C_FLAGS_RELEASE=${{ matrix.config.cflags }}"
"-DCMAKE_CXX_FLAGS_RELEASE=${{ matrix.config.cflags }}"
"-DCLANGD_ENABLE_REMOTE=ON"
"-DLLVM_ENABLE_ZSTD=OFF"
"-DGRPC_INSTALL_PATH=$HOME/grpc-installation"
${{ matrix.config.cmake }}
- name: Ninja
run: >
ninja -C ${{ env.CLANGD_DIR }} clangd clangd-indexer clangd-index-server
clangd-index-server-monitor
- name: Install OpenMP headers
shell: bash
run: >
cp ${{ env.CLANGD_DIR }}/projects/openmp/runtime/src/omp{,-tools}.h ${{ env.CLANGD_DIR }}/lib/clang/*/include
|| true # Don't let the non-existing omp headers block the release.
- name: Archive clangd
run: >
7z a clangd.zip
${{ env.CLANGD_DIR }}/LICENSE.TXT
${{ env.CLANGD_DIR }}/bin/clangd${{ matrix.config.binary_extension }}
${{ env.CLANGD_DIR }}/lib/clang
- name: Archive clangd PDB symbols
if: matrix.config.name == 'windows'
run: >
7z a clangd-pdb.7z -t7z -m0=LZMA2
${{ env.CLANGD_DIR }}/LICENSE.TXT
${{ env.CLANGD_DIR }}/bin/clangd.pdb
- name: Archive indexing-tools
run: >
7z a indexing-tools.zip
@ -177,18 +327,30 @@ jobs:
${{ env.CLANGD_DIR }}/lib/clang
- name: Upload clangd asset
uses: actions/upload-release-asset@v1.0.1
env: { GITHUB_TOKEN: "${{ secrets.RELEASE_TOKEN }}" }
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_name: clangd-${{ matrix.config.name }}-${{ github.event.release.tag_name }}.zip
upload_url: ${{ env.UPLOAD_URL }}
asset_name: clangd-${{ matrix.config.name }}-${{ env.TAG_NAME }}.zip
asset_path: clangd.zip
asset_content_type: application/zip
- name: Upload clangd PDB asset
if: matrix.config.name == 'windows'
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
with:
upload_url: ${{ env.UPLOAD_URL }}
asset_name: clangd-debug-symbols-${{ matrix.config.name }}-${{ env.TAG_NAME }}.7z
asset_path: clangd-pdb.7z
asset_content_type: application/zip
- name: Upload indexing-tools asset
uses: actions/upload-release-asset@v1.0.1
env: { GITHUB_TOKEN: "${{ secrets.RELEASE_TOKEN }}" }
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_name: clangd_indexing_tools-${{ matrix.config.name }}-${{ github.event.release.tag_name }}.zip
upload_url: ${{ env.UPLOAD_URL }}
asset_name: clangd_indexing_tools-${{ matrix.config.name }}-${{ env.TAG_NAME }}.zip
asset_path: indexing-tools.zip
asset_content_type: application/zip
- name: Check binary compatibility
@ -198,10 +360,21 @@ jobs:
finalize:
runs-on: ubuntu-latest
needs: build
if: always() && needs.build.result == 'success'
steps:
- name: Fetch release info
uses: actions/download-artifact@v4
with:
name:
release
path:
release
- name: Update the env variables
run: >
cat release/release.env >> $GITHUB_ENV
- name: Publish release
run: >
curl -XPATCH
"-HAuthorization: Bearer ${{ secrets.RELEASE_TOKEN }}"
"https://api.github.com/repos/${{ github.repository }}/releases/${{ github.event.release.id }}"
"https://api.github.com/repos/${{ github.repository }}/releases/${{ env.RELEASE_ID }}"
"-d" '{"draft": false}'

View File

@ -16,5 +16,6 @@ FORCE_SYMBOL_VERSION(expf, GLIBC_2.2.5);
FORCE_SYMBOL_VERSION(log, GLIBC_2.2.5);
FORCE_SYMBOL_VERSION(log2, GLIBC_2.2.5);
FORCE_SYMBOL_VERSION(pow, GLIBC_2.2.5);
FORCE_SYMBOL_VERSION(exp, GLIBC_2.2.5);
#undef FORCE_SYMBOL_VERSION

View File

@ -1,60 +0,0 @@
# Workflow to create an auto-buildable release periodically.
#
# Releases created with automation credentials don't trigger workflows.
# Therefore a token `secrets.RELEASE_TOKEN` must exist with public_repo scope.
name: Periodic release
on:
# Run weekly on sunday at 21:37 UTC (arbitrary)
schedule:
- cron: '37 21 * * SUN'
# Allow triggering manually:
# curl -XPOST -d '{"event_type":"periodic"}' \
# "-HAuthorization: Bearer <token>" \
# https://api.github.com/repos/clangd/clangd/dispatches
repository_dispatch: { types: periodic }
jobs:
# Choose the commit to build a release from.
#
# We want to avoid unbuildable revisions: choose the last green from CI.
# FIXME: the criteria should be some consistent set of buildbots passing.
pick:
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
# 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=$(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
id: release
env: { GITHUB_TOKEN: "${{ secrets.RELEASE_TOKEN }}" }
with:
tag_name: snapshot_${{ env.RELEASE_DATE }}
release_name: ${{ env.RELEASE_DATE }} @${{ env.RELEASE_COMMIT_SHORT }}
body: |
Unstable snapshot of clangd on ${{ env.RELEASE_DATE }}.
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.
# Instead, that workflow marks the release as draft until it's built.
# As a result, the empty release will be briefly visible to users.
draft: false