Skip to content

Commit

Permalink
Adjust CI for reactivation of custom llvm builds
Browse files Browse the repository at this point in the history
Changes:
- Optimize build for size
- Compress with xz instead of gz
- Only build a single release version in one branch, instead of repeatedly
  rebuilding all old releases
- Rename assets to `llvm-*`
  • Loading branch information
silwol authored and epilys committed Jun 14, 2022
1 parent b9461fa commit 1398c3f
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 30 deletions.
23 changes: 12 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- id: 'windows-amd64'
os: 'windows-2016'
llvm_prefix: llvm-project/build/Release
llvm_version: ['11.x', '12.x', '13.x']
llvm_version: ['13.x']
llvm_repo_url: ['https://github.com/llvm/llvm-project.git']
fail-fast: true

Expand Down Expand Up @@ -74,7 +74,8 @@ jobs:
run: |
mv ${{ matrix.target.llvm_prefix }} llvm-project/build/llvm
mkdir dist
tar -C llvm-project/build/llvm -zcvf dist/llvm.tar.gz .
tar -C llvm-project/build/llvm -cJvf dist/llvm.tar.xz .
ls -lh dist/llvm.tar.xz
- name: Upload Artifacts
uses: actions/upload-artifact@v2
Expand All @@ -94,7 +95,7 @@ jobs:

strategy:
matrix:
llvm_version: ['11.x', '12.x', '13.x']
llvm_version: ['13.x']

steps:
- name: Download the Artifacts
Expand Down Expand Up @@ -125,8 +126,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/linux-amd64-${{matrix.llvm_version}}/llvm.tar.gz
asset_name: linux-amd64.tar.gz
asset_path: artifacts/linux-amd64-${{matrix.llvm_version}}/llvm.tar.xz
asset_name: llvm-linux-amd64.tar.xz
asset_content_type: application/gzip

#- name: Upload Release Asset Linux (ARM64)
Expand All @@ -135,8 +136,8 @@ jobs:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: artifacts/linux-aarch64-${{matrix.llvm_version}}/llvm.tar.gz
# asset_name: linux-aarch64.tar.gz
# asset_path: artifacts/linux-aarch64-${{matrix.llvm_version}}/llvm.tar.xz
# asset_name: linux-aarch64.tar.xz
# asset_content_type: application/gzip

- name: Upload Release Asset Darwin
Expand All @@ -145,8 +146,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/darwin-amd64-${{matrix.llvm_version}}/llvm.tar.gz
asset_name: darwin-amd64.tar.gz
asset_path: artifacts/darwin-amd64-${{matrix.llvm_version}}/llvm.tar.xz
asset_name: llvm-darwin-amd64.tar.xz
asset_content_type: application/gzip

- name: Upload Release Asset Windows
Expand All @@ -155,6 +156,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/windows-amd64-${{matrix.llvm_version}}/llvm.tar.gz
asset_name: windows-amd64.tar.gz
asset_path: artifacts/windows-amd64-${{matrix.llvm_version}}/llvm.tar.xz
asset_name: llvm-windows-amd64.tar.xz
asset_content_type: application/gzip
32 changes: 16 additions & 16 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,22 @@ $CMAKE_ARGUMENTS = ""

# Run `cmake` to configure the project.
cmake `
-G "Visual Studio 15 2017 Win64" `
-DCMAKE_BUILD_TYPE=Release `
-DCMAKE_INSTALL_PREFIX=install `
-DLLVM_ENABLE_PROJECTS="clang;lld" `
-DLLVM_ENABLE_TERMINFO=OFF `
-DLLVM_ENABLE_ZLIB=OFF `
-DLLVM_INCLUDE_DOCS=OFF `
-DLLVM_INCLUDE_EXAMPLES=OFF `
-DLLVM_INCLUDE_GO_TESTS=OFF `
-DLLVM_INCLUDE_TESTS=OFF `
-DLLVM_INCLUDE_TOOLS=ON `
-DLLVM_INCLUDE_UTILS=OFF `
-DLLVM_OPTIMIZED_TABLEGEN=ON `
-DLLVM_TARGETS_TO_BUILD="X86;AArch64" `
$CMAKE_ARGUMENTS `
../llvm
-G "Visual Studio 15 2017 Win64" `
-DCMAKE_BUILD_TYPE=MinSizeRel `
-DCMAKE_INSTALL_PREFIX=install `
-DLLVM_ENABLE_PROJECTS="clang;lld" `
-DLLVM_ENABLE_TERMINFO=OFF `
-DLLVM_ENABLE_ZLIB=OFF `
-DLLVM_INCLUDE_DOCS=OFF `
-DLLVM_INCLUDE_EXAMPLES=OFF `
-DLLVM_INCLUDE_GO_TESTS=OFF `
-DLLVM_INCLUDE_TESTS=OFF `
-DLLVM_INCLUDE_TOOLS=ON `
-DLLVM_INCLUDE_UTILS=OFF `
-DLLVM_OPTIMIZED_TABLEGEN=ON `
-DLLVM_TARGETS_TO_BUILD="X86;AArch64" `
$CMAKE_ARGUMENTS `
../llvm

# Showtime!
cmake --build . --config Release --target INSTALL
6 changes: 3 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ mkdir -p build
cd build

# Create a directory to receive the complete installation.
mkdir install
mkdir -p install

# Adjust compilation based on the OS.
CMAKE_ARGUMENTS=""
Expand All @@ -49,7 +49,7 @@ esac
# Run `cmake` to configure the project.
cmake \
-G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_BUILD_TYPE=MinSizeRel \
-DCMAKE_INSTALL_PREFIX="install" \
-DLLVM_ENABLE_PROJECTS="clang;lld" \
-DLLVM_ENABLE_TERMINFO=OFF \
Expand All @@ -62,7 +62,7 @@ cmake \
-DLLVM_INCLUDE_UTILS=OFF \
-DLLVM_OPTIMIZED_TABLEGEN=ON \
-DLLVM_TARGETS_TO_BUILD="X86;AArch64" \
${CMAKE_ARGUMENTS} \
"${CMAKE_ARGUMENTS}" \
../llvm

# Showtime!
Expand Down

0 comments on commit 1398c3f

Please sign in to comment.