Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
166 changes: 166 additions & 0 deletions .github/workflows/build_binaries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
name: Build Binaries

on:
push:
branches:
- main
workflow_dispatch:

jobs:
linux-x86-64:
name: Linux x86-64
runs-on: solang-ubuntu-latest
container: ghcr.io/hyperledger/solang-llvm:ci-7
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: dtolnay/[email protected]
- name: Build
run: cargo build --verbose --release
- name: Test
run: cargo test --workspace --verbose --release
- name: Package
run: |
mkdir -p dist
cp target/release/solang dist/solang-linux-x86-64
- uses: actions/upload-artifact@v4
with:
name: solang-linux-x86-64
path: dist/solang-linux-x86-64

linux-arm64:
name: Linux arm64
runs-on: solang-arm
if: ${{ github.repository_owner == 'hyperledger-solang' }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Build tools
run: |
sudo apt-get update
sudo apt-get install -y gcc g++ make
- uses: dtolnay/[email protected]
- name: Get LLVM
run: curl -sSL --output llvm16.0-linux-arm64.tar.xz https://github.com/hyperledger-solang/solang-llvm/releases/download/llvm16-0/llvm16.0-linux-arm64.tar.xz
- name: Extract LLVM
run: tar Jxf llvm16.0-linux-arm64.tar.xz
- name: Add LLVM to PATH
run: echo "$(pwd)/llvm16.0/bin" >> $GITHUB_PATH
- name: Build
run: cargo build --verbose --release
- name: Test
run: cargo test --workspace --verbose --release
- name: Package
run: |
mkdir -p dist
cp target/release/solang dist/solang-linux-arm64
- uses: actions/upload-artifact@v4
with:
name: solang-linux-arm64
path: dist/solang-linux-arm64

windows:
name: Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Download LLVM
run: curl -sSL -o c:\llvm.zip https://github.com/hyperledger-solang/solang-llvm/releases/download/llvm16-0/llvm16.0-win.zip
- name: Extract LLVM
run: unzip c:\llvm.zip -d c:/
- name: Add LLVM to PATH
run: echo "c:\llvm16.0\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8
- uses: dtolnay/[email protected]
with:
components: clippy
- name: Build
run: cargo build --release --verbose
- name: Test
run: cargo test --workspace --release --verbose
- name: Package
run: |
mkdir dist
copy target\release\solang.exe dist\solang.exe
- uses: actions/upload-artifact@v4
with:
name: solang-windows
path: dist/solang.exe

mac-arm:
name: macOS arm64
runs-on: macos-13-xlarge
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: dtolnay/[email protected]
- name: Get LLVM
run: curl -sSL --output llvm16.0-mac-arm.tar.xz https://github.com/hyperledger-solang/solang-llvm/releases/download/llvm16-0/llvm16.0-mac-arm.tar.xz
- name: Extract LLVM
run: tar Jxf llvm16.0-mac-arm.tar.xz
- name: Add LLVM to PATH
run: echo "$(pwd)/llvm16.0/bin" >> $GITHUB_PATH
- name: Build
run: cargo build --release --verbose
- name: Test
run: cargo test --workspace --release --verbose
- name: Package
run: |
mkdir -p dist
cp target/release/solang dist/solang-mac-arm
- uses: actions/upload-artifact@v4
with:
name: solang-mac-arm
path: dist/solang-mac-arm

mac-intel:
name: macOS x86_64
runs-on: macos-13
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: dtolnay/[email protected]
- name: Get LLVM
run: wget -q -O llvm16.0-mac-intel.tar.xz https://github.com/hyperledger-solang/solang-llvm/releases/download/llvm16-0/llvm16.0-mac-intel.tar.xz
- name: Extract LLVM
run: tar Jxf llvm16.0-mac-intel.tar.xz
- name: Add LLVM to PATH
run: echo "$(pwd)/llvm16.0/bin" >> $GITHUB_PATH
- name: Build
run: cargo build --release --verbose
- name: Test
run: cargo test --workspace --release --verbose
- name: Package
run: |
mkdir -p dist
cp target/release/solang dist/solang-mac-intel
- uses: actions/upload-artifact@v4
with:
name: solang-mac-intel
path: dist/solang-mac-intel

mac-universal:
name: macOS Universal
runs-on: macos-latest
needs: [mac-arm, mac-intel]
steps:
- name: Download mac artifacts
uses: actions/download-artifact@v4
with:
path: ./mac
- name: Build universal binary
run: |
ls -R mac
lipo -create \
-output solang-mac \
mac/solang-mac-intel/solang-mac-intel \
mac/solang-mac-arm/solang-mac-arm
- uses: actions/upload-artifact@v4
with:
name: solang-mac-universal
path: solang-mac
Loading