@@ -2,20 +2,28 @@ name: build librashader-capi
22
33on :
44 push :
5- branches : [ "master" ]
5+ branches : ["master"]
66 pull_request :
7- branches : [ "master" ]
7+ branches : ["master"]
88 schedule :
99 - cron : " 0 0 * * 6"
1010env :
1111 CARGO_TERM_COLOR : always
1212
1313jobs :
14+ doc :
15+ name : Build docs.rs
16+ runs-on : ubuntu-latest
17+ steps :
18+ - uses : actions/checkout@v5
19+ - uses : dtolnay/rust-toolchain@nightly
20+ - uses : dtolnay/install@cargo-docs-rs
21+ - run : cargo docs-rs -p librashader
1422 build :
1523 strategy :
1624 matrix :
17- profile : [' debug', ' release', ' optimized' ]
18- os : [' windows-latest', ' ubuntu-latest', ' macos-latest', ' macos-14' ]
25+ profile : [" debug", " release", " optimized" ]
26+ os : [" windows-latest", " ubuntu-latest", " macos-latest", " macos-14" ]
1927 include :
2028 - os : ubuntu-latest
2129 output : x86_64-ubuntu
@@ -29,77 +37,77 @@ jobs:
2937 runs-on : ${{ matrix.os }}
3038 name : ${{ matrix.output }} (${{ matrix.profile }})
3139 steps :
32- - name : Checkout repository
33- uses : actions/checkout@v4
34- - name : Install nightly Rust
35- uses : dtolnay/rust-toolchain@master
36- with :
37- toolchain : nightly
38- - name : Build dynamic library
39- run : cargo run -p librashader-build-script -- --profile ${{ matrix.profile }}
40- - name : Upload build artifacts
41- uses : actions/upload-artifact@v4.4.0
42- with :
43- name : ${{ format('librashader-{0}-{1}-{2}', matrix.output, github.sha, matrix.profile) }}
44- path : ${{ format('target/{0}/librashader.*', matrix.profile) }}
45- - name : Install Ubuntu librashader CLI build dependencies
46- if : matrix.profile == 'release' && matrix.os == 'ubuntu-latest'
47- run : |
48- sudo apt-get update || true
49- sudo apt-get -y install xorg-dev
50- - name : Build librashader CLI
51- if : matrix.profile == 'release'
52- run : cargo build -p librashader-cli --release
53- - name : Upload librashader-cli
54- uses : actions/upload-artifact@v4.4.0
55- if : matrix.profile == 'release'
56- with :
57- name : ${{ format('librashader-cli-{0}-{1}', matrix.output, github.sha) }}
58- path : ${{ format('target/{0}/librashader-cli*', matrix.profile) }}
40+ - name : Checkout repository
41+ uses : actions/checkout@v4
42+ - name : Install nightly Rust
43+ uses : dtolnay/rust-toolchain@master
44+ with :
45+ toolchain : nightly
46+ - name : Build dynamic library
47+ run : cargo run -p librashader-build-script -- --profile ${{ matrix.profile }}
48+ - name : Upload build artifacts
49+ uses : actions/upload-artifact@v4.4.0
50+ with :
51+ name : ${{ format('librashader-{0}-{1}-{2}', matrix.output, github.sha, matrix.profile) }}
52+ path : ${{ format('target/{0}/librashader.*', matrix.profile) }}
53+ - name : Install Ubuntu librashader CLI build dependencies
54+ if : matrix.profile == 'release' && matrix.os == 'ubuntu-latest'
55+ run : |
56+ sudo apt-get update || true
57+ sudo apt-get -y install xorg-dev
58+ - name : Build librashader CLI
59+ if : matrix.profile == 'release'
60+ run : cargo build -p librashader-cli --release
61+ - name : Upload librashader-cli
62+ uses : actions/upload-artifact@v4.4.0
63+ if : matrix.profile == 'release'
64+ with :
65+ name : ${{ format('librashader-cli-{0}-{1}', matrix.output, github.sha) }}
66+ path : ${{ format('target/{0}/librashader-cli*', matrix.profile) }}
5967 build-ubuntu-arm64 :
6068 strategy :
6169 matrix :
62- profile : [' debug', ' release', ' optimized' ]
70+ profile : [" debug", " release", " optimized" ]
6371 fail-fast : false
6472 runs-on : ubuntu-latest
6573 name : aarch64-ubuntu
6674 steps :
67- - name : Checkout repository
68- uses : actions/checkout@v4
69- - name : Install nightly Rust
70- uses : dtolnay/rust-toolchain@master
71- with :
72- toolchain : nightly
73- targets : aarch64-unknown-linux-gnu
74- - name : Install ARM64 cross-compilation dependencies
75- continue-on-error : true
76- run : |
77- sudo apt-get update || true
78- sudo dpkg --add-architecture arm64
79- echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble main restricted" | sudo tee -a /etc/apt/sources.list
80- echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble-updates main restricted" | sudo tee -a /etc/apt/sources.list
81- sudo apt-get update || true
82- sudo apt-get -y install g++-aarch64-linux-gnu gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu xorg-dev libx11-dev:arm64 libxrandr-dev:arm64
83- - name : Build dynamic library
84- run : CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=/usr/bin/aarch64-linux-gnu-gcc cargo run -p librashader-build-script -- --profile ${{ matrix.profile }} --target aarch64-unknown-linux-gnu
85- - name : Upload build artifacts
86- uses : actions/upload-artifact@v4.4.0
87- with :
88- name : ${{ format('librashader-aarch64-ubuntu-{0}-{1}', github.sha, matrix.profile) }}
89- path : ${{ format('target/aarch64-unknown-linux-gnu/{0}/librashader.*', matrix.profile) }}
90- - name : Build librashader CLI
91- if : matrix.profile == 'release'
92- run : CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=/usr/bin/aarch64-linux-gnu-gcc cargo build -p librashader-cli --release --target aarch64-unknown-linux-gnu
93- - name : Upload librashader-cli
94- uses : actions/upload-artifact@v4.4.0
95- if : matrix.profile == 'release'
96- with :
97- name : ${{ format('librashader-cli-aarch64-ubuntu-{0}', github.sha) }}
98- path : ${{ format('target/aarch64-unknown-linux-gnu/{0}/librashader-cli', matrix.profile) }}
75+ - name : Checkout repository
76+ uses : actions/checkout@v4
77+ - name : Install nightly Rust
78+ uses : dtolnay/rust-toolchain@master
79+ with :
80+ toolchain : nightly
81+ targets : aarch64-unknown-linux-gnu
82+ - name : Install ARM64 cross-compilation dependencies
83+ continue-on-error : true
84+ run : |
85+ sudo apt-get update || true
86+ sudo dpkg --add-architecture arm64
87+ echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble main restricted" | sudo tee -a /etc/apt/sources.list
88+ echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble-updates main restricted" | sudo tee -a /etc/apt/sources.list
89+ sudo apt-get update || true
90+ sudo apt-get -y install g++-aarch64-linux-gnu gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu xorg-dev libx11-dev:arm64 libxrandr-dev:arm64
91+ - name : Build dynamic library
92+ run : CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=/usr/bin/aarch64-linux-gnu-gcc cargo run -p librashader-build-script -- --profile ${{ matrix.profile }} --target aarch64-unknown-linux-gnu
93+ - name : Upload build artifacts
94+ uses : actions/upload-artifact@v4.4.0
95+ with :
96+ name : ${{ format('librashader-aarch64-ubuntu-{0}-{1}', github.sha, matrix.profile) }}
97+ path : ${{ format('target/aarch64-unknown-linux-gnu/{0}/librashader.*', matrix.profile) }}
98+ - name : Build librashader CLI
99+ if : matrix.profile == 'release'
100+ run : CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=/usr/bin/aarch64-linux-gnu-gcc cargo build -p librashader-cli --release --target aarch64-unknown-linux-gnu
101+ - name : Upload librashader-cli
102+ uses : actions/upload-artifact@v4.4.0
103+ if : matrix.profile == 'release'
104+ with :
105+ name : ${{ format('librashader-cli-aarch64-ubuntu-{0}', github.sha) }}
106+ path : ${{ format('target/aarch64-unknown-linux-gnu/{0}/librashader-cli', matrix.profile) }}
99107 build-windows-arm64 :
100108 strategy :
101109 matrix :
102- profile : [' debug', ' release', ' optimized' ]
110+ profile : [" debug", " release", " optimized" ]
103111 fail-fast : false
104112 runs-on : windows-latest
105113 name : aarch64-windows
@@ -130,7 +138,7 @@ jobs:
130138 build-windows-7 :
131139 strategy :
132140 matrix :
133- profile : [' release', ' optimized' ]
141+ profile : [" release", " optimized" ]
134142 fail-fast : false
135143 runs-on : windows-latest
136144 name : x86_64-win7-windows
0 commit comments