Skip to content

Commit c5ac7de

Browse files
authored
Add release package build for linux aarch64 (shader-slang#3612)
1 parent 1c76f2e commit c5ac7de

File tree

2 files changed

+64
-3
lines changed

2 files changed

+64
-3
lines changed
+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
on:
2+
push:
3+
# Sequence of patterns matched against refs/tags
4+
tags:
5+
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
6+
7+
name: Linux ARM64 Release
8+
9+
jobs:
10+
build:
11+
name: Upload Release Asset
12+
runs-on: ['self-hosted', 'Linux', 'ARM64']
13+
strategy:
14+
matrix:
15+
configuration: ['release']
16+
compiler: ['gcc']
17+
platform: ['aarch64']
18+
targetPlatform: ['aarch64']
19+
steps:
20+
- uses: actions/checkout@v3
21+
with:
22+
submodules: 'true'
23+
fetch-depth: '0'
24+
- name: Build release project
25+
id: build
26+
run: |
27+
echo "starting to build..."
28+
export CC=${{matrix.compiler}}
29+
export CONFIGURATION=${{matrix.configuration}}
30+
export ARCH=${{matrix.platform}}
31+
export TARGETARCH=${{matrix.targetPlatform}}
32+
echo "building..."
33+
source ./github_build.sh
34+
echo "creating binary archieves..."
35+
export SLANG_OS_NAME=linux
36+
export SLANG_ARCH_NAME=`uname -p`
37+
export TAG_NAME=`git describe --tags`
38+
export SLANG_TAG=${TAG_NAME#v}
39+
echo "tag:$TAG_NAME"
40+
echo "slang-tag:$SLANG_TAG"
41+
export SLANG_BINARY_ARCHIVE=slang-${SLANG_TAG}-${SLANG_OS_NAME}-${SLANG_ARCH_NAME}.zip
42+
export SLANG_BINARY_ARCHIVE_TAR=slang-${SLANG_TAG}-${SLANG_OS_NAME}-${SLANG_ARCH_NAME}.tar.gz
43+
echo "creating zip"
44+
zip -r ${SLANG_BINARY_ARCHIVE} bin/*/*/slangc bin/*/*/slangd bin/*/*/libslang.so bin/*/*/libslang-glslang.so bin/*/*/libgfx.so docs/*.md README.md LICENSE slang.h slang-com-helper.h slang-com-ptr.h slang-tag-version.h slang-gfx.h prelude/*.h
45+
echo "creating tar"
46+
tar -czf ${SLANG_BINARY_ARCHIVE_TAR} bin/*/*/slangc bin/*/*/slangd bin/*/*/libslang.so bin/*/*/libslang-glslang.so bin/*/*/libgfx.so docs/*.md README.md LICENSE slang.h slang-com-helper.h slang-com-ptr.h slang-tag-version.h slang-gfx.h prelude/*.h
47+
echo "SLANG_BINARY_ARCHIVE=${SLANG_BINARY_ARCHIVE}" >> $GITHUB_OUTPUT
48+
echo "SLANG_BINARY_ARCHIVE_TAR=${SLANG_BINARY_ARCHIVE_TAR}" >> $GITHUB_OUTPUT
49+
- name: UploadBinary
50+
uses: softprops/action-gh-release@v1
51+
with:
52+
files: |
53+
${{ steps.build.outputs.SLANG_BINARY_ARCHIVE }}
54+
${{ steps.build.outputs.SLANG_BINARY_ARCHIVE_TAR }}
55+
env:
56+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

github_build.sh

+8-3
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,27 @@ if [[ "" == "${TARGETARCH}" ]]; then
1515
TARGETARCH=${ARCH}
1616
fi
1717

18+
glslangBuildFlag=""
19+
if [[ "aarch64" == "${TARGETARCH}" && "release" == "${CONFIGURATION}" ]]; then
20+
glslangBuildFlag="--build-glslang=true"
21+
fi
22+
1823
if [[ "${ARCH}" != "${TARGETARCH}" ]]; then
1924

2025
# Create the makefile
21-
./premake5 gmake2 --cc=${CC} --enable-embed-stdlib=true --arch=${ARCH} --deps=true --no-progress=true
26+
./premake5 gmake2 --cc=${CC} --enable-embed-stdlib=true --arch=${ARCH} --deps=true --no-progress=true ${glslangBuildFlag}
2227

2328
# Build the configuration
2429
make config=${CONFIGURATION}_${ARCH} -j`nproc`
2530

2631
rm -rf ./bin
2732

2833
# Create the makefile
29-
./premake5 gmake2 --cc=${CC} --enable-embed-stdlib=true --arch=${TARGETARCH} --deps=true --no-progress=true --skip-source-generation=true --deploy-slang-llvm=false --deploy-slang-glslang=false
34+
./premake5 gmake2 --cc=${CC} --enable-embed-stdlib=true --arch=${TARGETARCH} --deps=true --no-progress=true --skip-source-generation=true --deploy-slang-llvm=false --deploy-slang-glslang=false ${glslangBuildFlag}
3035

3136
else
3237
# Create the makefile
33-
./premake5 gmake2 --cc=${CC} --enable-embed-stdlib=true --arch=${TARGETARCH} --deps=true --no-progress=true
38+
./premake5 gmake2 --cc=${CC} --enable-embed-stdlib=true --arch=${TARGETARCH} --deps=true --no-progress=true ${glslangBuildFlag}
3439
fi
3540

3641
# Build the configuration

0 commit comments

Comments
 (0)