Skip to content

Commit

Permalink
Shoot for portable compression
Browse files Browse the repository at this point in the history
  • Loading branch information
dabrahams committed Feb 14, 2024
1 parent 68b833d commit 1019ee2
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions .github/workflows/llvm-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ jobs:
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
arch: [amd64, arm64]

include:
# Default values
- c_compiler: clang
Expand All @@ -133,6 +133,8 @@ jobs:
- executable_suffix:
- llvm_enable_projects: 'clang;lld'
- static_lib_suffix: .a
- package_command: tar cjf
- package_suffix: .tar.bz2

# Overrides
- into_environment: '| Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append'
Expand Down Expand Up @@ -170,6 +172,10 @@ jobs:
- static_lib_suffix: .lib
os: windows-latest

- package_command: 7z a -t7z
package_suffix: .7z
os: windows-latest

# Extensions
- triple_cpu: x86_64
arch: amd64
Expand All @@ -192,7 +198,7 @@ jobs:
# Must be a full version string from https://www.nuget.org/packages/pythonarm64
PYTHON_VERSION: 3.12.2
TARGET_TRIPLE: ${{ matrix.triple_cpu }}-${{ matrix.triple_suffix }}
LLVM_CONFIG: llvm-${{ matrix.triple_cpu }}-${{ matrix.triple_suffix }}-release
PACKAGE_NAME: llvm-${{ matrix.triple_cpu }}-${{ matrix.triple_suffix }}-release

steps:
- uses: actions/download-artifact@v4
Expand Down Expand Up @@ -308,7 +314,7 @@ jobs:
-D CMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }}
-D CMAKE_CXX_COMPILER_LAUNCHER=sccache
-D CMAKE_MT=mt
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/${{ env.LLVM_CONFIG }}
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/${{ env.PACKAGE_NAME }}
-S ${{ github.workspace }}/SourceCache/llvm-project/llvm
-D CLANG_TABLEGEN=${{ github.workspace }}/BinaryCache/0/bin/clang-tblgen${{ matrix.executable_suffix }}
-D CLANG_TIDY_CONFUSABLE_CHARS_GEN=${{ github.workspace }}/BinaryCache/0/bin/clang-tidy-confusable-chars-gen${{ matrix.executable_suffix }}
Expand Down Expand Up @@ -346,14 +352,18 @@ jobs:
path: ${{ github.workspace }}/BuildRoot/

- name: Package LLVM
run: |
7z a -t7z ${{ env.LLVM_CONFIG }}.7z ${{ github.workspace }}\BuildRoot\${{ env.LLVM_CONFIG }}
if: ${{ matrix.os == 'windows-latest' }}
run: >-
${{ matrix.package_command }}
${{ env.PACKAGE_NAME }}.${{ matrix.package_suffix }}
${{ github.workspace }}/BuildRoot/${{ env.PACKAGE_NAME }}
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: ${{ env.LLVM_CONFIG }}.7z
files: ${{ env.PACKAGE_NAME }}.${{ matrix.package_suffix }}

# TODO(compnerd) this takes ~1h due to the size, see if we can compress first
- uses: actions/upload-artifact@v4
Expand All @@ -369,4 +379,3 @@ jobs:
accountName: ${{ vars.SYMBOL_SERVER_ACCOUNT }}
personalAccessToken: ${{ secrets.SYMBOL_SERVER_PAT }}
symbolsFolder: ${{ github.workspace }}/BinaryCache/1

0 comments on commit 1019ee2

Please sign in to comment.