Skip to content

[CI] Use gh release for upload asset #43

[CI] Use gh release for upload asset

[CI] Use gh release for upload asset #43

Workflow file for this run

name: build
concurrency:
group: build-${{ github.head_ref }}
cancel-in-progress: true
on:
push:
branches:
- main
tags-ignore:
- llvmorg-*
pull_request:
branches:
- main
jobs:
build:
name: Build llvm on Windows
runs-on: windows-2022
strategy:
matrix:
rtlib: ["MultiThreadedDLL"]
steps:
- name: Install dependency
uses: crazy-max/ghaction-chocolatey@v1
with:
args: install cmake ninja vswhere
- name: Upgrade dependency
uses: crazy-max/ghaction-chocolatey@v1
with:
args: upgrade llvm
- uses: GuillaumeFalourd/setup-windows10-sdk-action@v2
with:
sdk-version: 22621
- name: Checkout by pushing tags
run: git clone --branch llvmorg-17.0.6 --depth 1 https://github.com/llvm/llvm-project.git
- name: Build llvm stage 1
run: |
$vsPath = (vswhere -latest -property installationPath)
Import-Module (Join-Path $vsPath "Common7\Tools\Microsoft.VisualStudio.DevShell.dll")
Enter-VsDevShell -VsInstallPath $vsPath -SkipAutomaticLocation -DevCmdArguments "-arch=x64 -host_arch=x64 -winsdk=10.0.22621.0"
$Env:CC = "clang-cl"
$Env:CXX = "clang-cl"
$cmake_sys_ver = "10.0.22621.0"
cmake -Bbuild -GNinja "-DCMAKE_SYSTEM_VERSION=$cmake_sys_ver" -DCMAKE_MSVC_RUNTIME_LIBRARY=${{ matrix.rtlib }} -DCMAKE_BUILD_TYPE=Release -DCPACK_GENERATOR=ZIP "-DCMAKE_INSTALL_PREFIX=$pwd\\prefix" -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_ENABLE_PROJECTS="lld;clang;clang-tools-extra" -DLLVM_ENABLE_DIA_SDK=OFF llvm-project\\llvm
cmake --build build --target package
Expand-Archive -Path build/*.zip -DestinationPath "$pwd"
cmake -E rm -Rf build
- name: Build llvm stage 2
run: |
$vsPath = (vswhere -latest -property installationPath)
Import-Module (Join-Path $vsPath "Common7\Tools\Microsoft.VisualStudio.DevShell.dll")
Enter-VsDevShell -VsInstallPath $vsPath -SkipAutomaticLocation -DevCmdArguments "-arch=x64 -host_arch=x64 -winsdk=10.0.22621.0"
$Env:CC = "$pwd\\LLVM-17.0.6-win64\\bin\\clang-cl.exe"
$Env:CXX = "$pwd\\LLVM-17.0.6-win64\\bin\\clang-cl.exe"
$cmake_sys_ver = "10.0.22621.0"
cmake -Bbuild -GNinja "-DCMAKE_SYSTEM_VERSION=$cmake_sys_ver" -DCMAKE_MSVC_RUNTIME_LIBRARY=${{ matrix.rtlib }} -DCMAKE_BUILD_TYPE=Release -DCPACK_GENERATOR=ZIP "-DCMAKE_INSTALL_PREFIX=$pwd\\prefix" -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_ENABLE_PROJECTS="lld;clang;clang-tools-extra" -DLLVM_ENABLE_DIA_SDK=OFF llvm-project\\llvm
cmake --build build --target package
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: llvm-${{ matrix.rtlib }}
path: build/*.zip
retention-days: 14