Skip to content

Commit

Permalink
separate small script for old glibc releases
Browse files Browse the repository at this point in the history
  • Loading branch information
expipiplus1 committed Jul 9, 2024
1 parent 36975c6 commit cef60bf
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 42 deletions.
72 changes: 37 additions & 35 deletions .github/workflows/release-linux-glibc-2-17.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
on:
push:
tags:
- 'v*'

name: centos7-gcc9 Release
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: 'true'
fetch-depth: '0'
Expand All @@ -14,43 +17,42 @@ jobs:
- name: Run the build process with Docker
uses: addnab/docker-run-action@v3
with:
image: slangdeveloper/centos7-gcc9
options: -v ${{ github.workspace }}:/home/app -v /etc/ssl/certs/ca-certificates.crt:/etc/ssl/certs/ca-certificates.crt
run: |
source /opt/rh/devtoolset-9/enable
cd /home/app
git config --global --add safe.directory /home/app
export CC=gcc
export CONFIGURATION=release
export ARCH=x64
export TARGETARCH=x64
export TARGETARCH=x64
export GLIBC_COMPATIBLE=1
/bin/bash ./github_build.sh
- name: CreatePackages
id: build
image: slangdeveloper/centos7-gcc9
options: -v ${{ github.workspace }}:/home/app -v /etc/ssl/certs/ca-certificates.crt:/etc/ssl/certs/ca-certificates.crt
run: |
source /opt/rh/devtoolset-9/enable
cd /home/app
git config --global --add safe.directory /home/app
cmake --preset default --fresh -DSLANG_SLANG_LLVM_FLAVOR=DISABLED -DSLANG_EMBED_STDLIB=1
cmake --workflow --preset release
- name: Package Slang
id: package
run: |
echo "creating binary archieves..."
export SLANG_OS_NAME=linux
export SLANG_ARCH_NAME=`uname -p`
export TAG_NAME=`git describe --tags`
export SLANG_TAG=${TAG_NAME#v}
echo "tag:$TAG_NAME"
echo "slang-tag:$SLANG_TAG"
export SLANG_BINARY_ARCHIVE=slang-${SLANG_TAG}-${SLANG_OS_NAME}-${SLANG_ARCH_NAME}-glibc-2.17.zip
export SLANG_BINARY_ARCHIVE_TAR=slang-${SLANG_TAG}-${SLANG_OS_NAME}-${SLANG_ARCH_NAME}-glibc-2.17.tar.gz
echo "creating zip"
zip -r ${SLANG_BINARY_ARCHIVE} bin/*/*/slangc bin/*/*/slangd bin/*/*/libslang.so bin/*/*/libslang-glslang.so bin/*/*/libgfx.so bin/*/*/libslang-llvm.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
echo "creating tar"
tar -czf ${SLANG_BINARY_ARCHIVE_TAR} bin/*/*/slangc bin/*/*/slangd bin/*/*/libslang.so bin/*/*/libslang-glslang.so bin/*/*/libgfx.so bin/*/*/libslang-llvm.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
echo "SLANG_BINARY_ARCHIVE=${SLANG_BINARY_ARCHIVE}" >> $GITHUB_OUTPUT
echo "SLANG_BINARY_ARCHIVE_TAR=${SLANG_BINARY_ARCHIVE_TAR}" >> $GITHUB_OUTPUT
# For the release, also generate a tar.gz file
cpack --preset "$config" -G ZIP
cpack --preset "$config" -G TGZ
triggering_ref=${{ github.ref_name }}
version=${triggering_ref#v}
base=$(pwd)/slang-${version}-linux-x86_64-glibc-2.17
mv "$(pwd)/build/dist-${config}/slang.zip" "${base}.zip"
echo "SLANG_BINARY_ARCHIVE_ZIP=${base}.zip" >> $GITHUB_OUTPUT
mv "$(pwd)/build/dist-${config}/slang.tar.gz" "${base}.tar.gz"
echo "SLANG_BINARY_ARCHIVE_TAR=${base}.tar.gz" >> $GITHUB_OUTPUT
- name: File check
run: |
find "build/dist-$config" ! -iname '*.md' ! -iname '*.h' -type f | xargs file
- name: UploadBinary
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/v')
with:
files: |
${{ steps.build.outputs.SLANG_BINARY_ARCHIVE }}
${{ steps.build.outputs.SLANG_BINARY_ARCHIVE_TAR }}
${{ steps.package.outputs.SLANG_BINARY_ARCHIVE_ZIP }}
${{ steps.package.outputs.SLANG_BINARY_ARCHIVE_TAR }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 1 addition & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,19 @@ jobs:
release:
strategy:
matrix:
os: [linux, linux-glibc-2.17, macos, windows]
os: [linux, macos, windows]
config: [release]
platform: [x86_64, aarch64]
test-category: [smoke]
include:
- {os: linux, runs-on: ubuntu-20.04, compiler: gcc}
- {os: linux-glibc-2.17, runs-on: ubuntu-20.04, compiler: gcc}
- {os: windows, runs-on: windows-latest, compiler: cl}
- {os: macos, runs-on: macos-latest, compiler: clang}

- {build-slang-llvm: false}
- {os: linux, platform: x86_64, build-slang-llvm: true}
- {os: linux-glibc-2.17, platform: x86_64, build-slang-llvm: true}
- {os: windows, platform: x86_64, build-slang-llvm: true}
- {os: macos, platform: aarch64, build-slang-llvm: true}

- {os: linux-glibc-2.17, platform: x86_64, image: slangdeveloper/centos7-gcc9}
exclude:
- {os: linux-glibc-2.17, platform: aarch64}
fail-fast: false
runs-on: ${{ matrix.runs-on }}
container: ${{ matrix.image || '' }}
Expand Down

0 comments on commit cef60bf

Please sign in to comment.