From a233c066890b425af123d6ccc554ae78a67a01f0 Mon Sep 17 00:00:00 2001 From: Sean Young Date: Thu, 26 Aug 2021 19:47:48 +0100 Subject: [PATCH] Release should build llvm and solang Signed-off-by: Sean Young --- .github/workflows/release.yml | 95 +++++++++++++++++++++++++++++------ 1 file changed, 80 insertions(+), 15 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 95a35793f..f71530fd7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,11 +9,29 @@ jobs: linux: name: Linux runs-on: ubuntu-20.04 - container: hyperledgerlabs/solang:ci steps: - name: Checkout sources - # checkout@v2 requires git 2.18 or higher, which is not in our image - uses: actions/checkout@v1 + uses: actions/checkout@v2 + - run: git clone --depth 1 --branch solana-rustc/12.0-2021-04-15 git://github.com/solana-labs/llvm-project.git + - name: Install Ninja + uses: llvm/actions/install-ninja@main + - run: cmake -G Ninja -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_ENABLE_TERMINFO=Off + -DLLVM_ENABLE_PROJECTS='clang;lld' + -DLLVM_TARGETS_TO_BUILD='WebAssembly\;BPF' + -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=../llvm12.0 llvm + working-directory: ./llvm-project/ + - run: cmake --build . --target install + working-directory: ./llvm-project/ + - run: tar Jcf ./llvm12.0-linux-x86-64.tar.xz ./llvm12.0/ + - name: Upload llvm + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: llvm12.0-linux-x86-64.tar.xz + asset_name: llvm12.0-linux-x86-64.tar.xz + tag: ${{ github.ref }} + - name: Add LLVM to Path + run: echo "$(pwd)/llvm12.0/bin" >> $GITHUB_PATH - name: Rust stable run: rustup default 1.53.0 - name: Build @@ -34,10 +52,29 @@ jobs: steps: - name: Checkout sources uses: actions/checkout@v2 - - name: Download LLVM - run: curl -sSL -o c:\llvm.zip https://github.com/hyperledger-labs/solang/releases/download/llvm12.0-1/llvm12.0-win.zip - - name: Extract LLVM - run: unzip c:\llvm.zip -d c:/ + - run: git clone --depth 1 --branch solana-rustc/12.0-2021-04-15 git://github.com/solana-labs/llvm-project.git + # We may not have enough space to compile llvm, see https://github.com/actions/virtual-environments/issues/326 + working-directory: C:\ + - name: Setup Windows + uses: llvm/actions/setup-windows@main + with: + arch: amd64 + - name: Install Ninja + uses: llvm/actions/install-ninja@main + - run: cmake -G Ninja -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_ENABLE_TERMINFO=Off + '-DLLVM_ENABLE_PROJECTS=clang;lld' + -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=C:/llvm12.0 llvm + working-directory: C:\llvm-project + - run: cmake --build . --target install + working-directory: C:\llvm-project + - run: Compress-Archive -Path C:\llvm12.0 -DestinationPath C:\llvm12.0-win.zip + - name: Upload llvm + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: C:\llvm12.0-win.zip + asset_name: llvm12.0-win.zip + tag: ${{ github.ref }} - name: Add LLVM to Path run: echo "c:\llvm12.0\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 - name: Build @@ -58,10 +95,24 @@ jobs: steps: - name: Checkout sources uses: actions/checkout@v2 - - name: Download LLVM - run: wget -q -O llvm12.0-mac-arm.tar.xz https://github.com/hyperledger-labs/solang/releases/download/llvm12.0-1/llvm12.0-mac-arm.tar.xz - - name: Extract LLVM - run: tar Jxf llvm12.0-mac-arm.tar.xz + - run: git clone --depth 1 --branch solana-rustc/12.0-2021-04-15 git://github.com/solana-labs/llvm-project.git + - name: Install Ninja + uses: llvm/actions/install-ninja@main + - run: arch -arm64 cmake -G Ninja -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_ENABLE_TERMINFO=Off + -DLLVM_ENABLE_PROJECTS='clang;lld' + -DLLVM_TARGETS_TO_BUILD='WebAssembly;BPF' + -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=../llvm12.0 llvm + working-directory: ./llvm-project/ + - run: arch -arm64 cmake --build . --target install + working-directory: ./llvm-project/ + - run: tar Jcf ./llvm12.0-mac-arm.tar.xz ./llvm12.0/ + - name: Upload llvm + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: llvm12.0-mac-arm.tar.xz + asset_name: llvm12.0-mac-arm.tar.xz + tag: ${{ github.ref }} - name: Add LLVM to Path run: echo "$(pwd)/llvm12.0/bin" >> $GITHUB_PATH - name: Build @@ -82,10 +133,24 @@ jobs: steps: - name: Checkout sources uses: actions/checkout@v2 - - name: Download LLVM - run: wget -q -O llvm12.0-mac-intel.tar.xz https://github.com/hyperledger-labs/solang/releases/download/llvm12.0-1/llvm12.0-mac-intel.tar.xz - - name: Extract LLVM - run: tar Jxf llvm12.0-mac-intel.tar.xz + - run: git clone --depth 1 --branch solana-rustc/12.0-2021-04-15 git://github.com/solana-labs/llvm-project.git + - name: Install Ninja + uses: llvm/actions/install-ninja@main + - run: cmake -G Ninja -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_ENABLE_TERMINFO=Off + -DLLVM_ENABLE_PROJECTS='clang;lld' + -DLLVM_TARGETS_TO_BUILD='WebAssembly;BPF' + -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=../llvm12.0 llvm + working-directory: ./llvm-project/ + - run: cmake --build . --target install + working-directory: ./llvm-project/ + - run: tar Jcf ./llvm12.0-mac-intel.tar.xz ./llvm12.0/ + - name: Upload llvm + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: llvm12.0-mac-intel.tar.xz + asset_name: llvm12.0-mac-intel.tar.xz + tag: ${{ github.ref }} - name: Add LLVM to Path run: echo "$(pwd)/llvm12.0/bin" >> $GITHUB_PATH - name: Build