Skip to content

Commit 2508a74

Browse files
add read permissions
Signed-off-by: salaheldinsoliman <salaheldin_sameh@aucegypt.edu>
1 parent 5b33677 commit 2508a74

File tree

1 file changed

+142
-0
lines changed

1 file changed

+142
-0
lines changed
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
name: Build Binaries
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
workflow_dispatch:
11+
12+
jobs:
13+
linux-x86-64:
14+
name: Linux x86-64
15+
runs-on: solang-ubuntu-latest
16+
container: ghcr.io/hyperledger/solang-llvm:ci-7
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
submodules: recursive
21+
- uses: dtolnay/rust-toolchain@1.85.0
22+
- name: Build
23+
run: cargo build --verbose --release
24+
- name: Test
25+
run: cargo test --workspace --verbose --release
26+
- name: Package
27+
run: |
28+
mkdir -p dist
29+
cp target/release/solang dist/solang-linux-x86-64
30+
- uses: actions/upload-artifact@v4
31+
with:
32+
name: solang-linux-x86-64
33+
path: dist/solang-linux-x86-64
34+
35+
linux-arm64:
36+
name: Linux arm64
37+
runs-on: solang-arm
38+
if: ${{ github.repository_owner == 'hyperledger-solang' }}
39+
steps:
40+
- uses: actions/checkout@v4
41+
with:
42+
submodules: recursive
43+
- run: |
44+
sudo apt-get update
45+
sudo apt-get install -y gcc g++ make
46+
- uses: dtolnay/rust-toolchain@1.85.0
47+
- 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
48+
- run: tar Jxf llvm16.0-linux-arm64.tar.xz
49+
- run: echo "$(pwd)/llvm16.0/bin" >> $GITHUB_PATH
50+
- run: cargo build --verbose --release
51+
- run: cargo test --workspace --verbose --release
52+
- run: |
53+
mkdir -p dist
54+
cp target/release/solang dist/solang-linux-arm64
55+
- uses: actions/upload-artifact@v4
56+
with:
57+
name: solang-linux-arm64
58+
path: dist/solang-linux-arm64
59+
60+
windows:
61+
name: Windows
62+
runs-on: windows-latest
63+
steps:
64+
- uses: actions/checkout@v4
65+
with:
66+
submodules: recursive
67+
- run: curl -sSL -o c:\llvm.zip https://github.com/hyperledger-solang/solang-llvm/releases/download/llvm16-0/llvm16.0-win.zip
68+
- run: unzip c:\llvm.zip -d c:/
69+
- run: echo "c:\llvm16.0\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8
70+
- uses: dtolnay/rust-toolchain@1.85.0
71+
with:
72+
components: clippy
73+
- run: cargo build --release --verbose
74+
- run: cargo test --workspace --release --verbose
75+
- run: |
76+
mkdir dist
77+
copy target\release\solang.exe dist\solang.exe
78+
- uses: actions/upload-artifact@v4
79+
with:
80+
name: solang-windows
81+
path: dist/solang.exe
82+
83+
mac-arm:
84+
name: macOS arm64
85+
runs-on: macos-13-xlarge
86+
steps:
87+
- uses: actions/checkout@v4
88+
with:
89+
submodules: recursive
90+
- uses: dtolnay/rust-toolchain@1.85.0
91+
- 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
92+
- run: tar Jxf llvm16.0-mac-arm.tar.xz
93+
- run: echo "$(pwd)/llvm16.0/bin" >> $GITHUB_PATH
94+
- run: cargo build --release --verbose
95+
- run: cargo test --workspace --release --verbose
96+
- run: |
97+
mkdir -p dist
98+
cp target/release/solang dist/solang-mac-arm
99+
- uses: actions/upload-artifact@v4
100+
with:
101+
name: solang-mac-arm
102+
path: dist/solang-mac-arm
103+
104+
mac-intel:
105+
name: macOS x86_64
106+
runs-on: macos-13
107+
steps:
108+
- uses: actions/checkout@v4
109+
with:
110+
submodules: recursive
111+
- uses: dtolnay/rust-toolchain@1.85.0
112+
- 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
113+
- run: tar Jxf llvm16.0-mac-intel.tar.xz
114+
- run: echo "$(pwd)/llvm16.0/bin" >> $GITHUB_PATH
115+
- run: cargo build --release --verbose
116+
- run: cargo test --workspace --release --verbose
117+
- run: |
118+
mkdir -p dist
119+
cp target/release/solang dist/solang-mac-intel
120+
- uses: actions/upload-artifact@v4
121+
with:
122+
name: solang-mac-intel
123+
path: dist/solang-mac-intel
124+
125+
mac-universal:
126+
name: macOS Universal
127+
runs-on: macos-latest
128+
needs: [mac-arm, mac-intel]
129+
steps:
130+
- uses: actions/download-artifact@v4
131+
with:
132+
path: ./mac
133+
- run: |
134+
ls -R mac
135+
lipo -create \
136+
-output solang-mac \
137+
mac/solang-mac-intel/solang-mac-intel \
138+
mac/solang-mac-arm/solang-mac-arm
139+
- uses: actions/upload-artifact@v4
140+
with:
141+
name: solang-mac-universal
142+
path: solang-mac

0 commit comments

Comments
 (0)