Update clangd.yml #17
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
name: clangd | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-24.04 | |
arch: amd64 | |
- os: ubuntu-24.04 | |
arch: aarch64 | |
- os: macos-15-large | |
arch: amd64 | |
- os: macos-15 | |
arch: aarch64 | |
- os: windows-latest | |
arch: amd64 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
repository: llvm/llvm-project | |
- name: Install essential packages (Ubuntu) | |
if: ${{ contains(matrix.os, 'ubuntu') }} | |
run: sudo apt-get install -y ninja-build gcc-aarch64-linux-gnu g++-aarch64-linux-gnu | |
- name: Install essential packages (Windows) | |
if: ${{ contains(matrix.os, 'windows') }} | |
run: choco install ninja | |
- name: Install essential packages (MacOS) | |
if: ${{ contains(matrix.os, 'macos') }} | |
run: brew install ninja | |
- name: Build (Ubuntu AArch64) | |
if: ${{ contains(matrix.os, 'ubuntu') && contains(matrix.arch, 'aarch64') }} | |
run: | | |
mkdir build | |
cd build | |
cmake -G Ninja ../llvm/ -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra" -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=aarch64 -DCMAKE_C_COMPILER=/usr/bin/aarch64-linux-gnu-gcc -DCMAKE_CXX_COMPILER=/usr/bin/aarch64-linux-gnu-g++ | |
cmake --build ./ --target clangd | |
cd .. | |
- name: Build | |
if: ${{ !contains(matrix.os, 'ubuntu') || !contains(matrix.arch, 'aarch64') }} | |
run: | | |
mkdir build | |
cd build | |
cmake -G Ninja ../llvm/ -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra" | |
cmake --build ./ --target clangd | |
cd .. | |
- name: Rename file (Ubuntu, MacOS) | |
if: ${{ !contains(matrix.os, 'windows') }} | |
run: zip -r ${{ matrix.os }}-${{ matrix.arch }}.zip ./build/bin | |
- name: Rename file (Windows) | |
if: ${{ contains(matrix.os, 'windows') }} | |
run: Compress-Archive -Path ./build/bin -DestinationPath ${{ matrix.os }}-${{ matrix.arch }}.zip | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: my-artifact | |
path: ${{ matrix.os }}-${{ matrix.arch }}.zip | |
release: | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set current date as env variable | |
run: echo "NOW=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_ENV | |
- uses: rickstaa/action-create-tag@main | |
id: "tag_create" | |
with: | |
tag: "${{ env.NOW }}" | |
tag_exists_error: false | |
message: "Release ${{ env.NOW }}" | |
- name: Download artifacts | |
uses: actions/download-artifact@main | |
with: | |
name: my-artifact | |
path: artifacts | |
- name: Display structure of downloaded files | |
run: ls -al artifacts | |
- name: Create release | |
uses: ncipollo/release-action@main | |
with: | |
artifacts: artifacts/* | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ env.NOW }} | |
generateReleaseNotes: true | |
draft: false | |
prerelease: false |