Skip to content

Run cmake outside of docker #54

Run cmake outside of docker

Run cmake outside of docker #54

on:
push:
tags:
- 'v*'
name: centos7-gcc9 Release
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: 'true'
fetch-depth: '0'
- run: |
cmake \
--preset default --fresh \
-DCMAKE_BUILD_TYPE=Release \
-DSLANG_SLANG_LLVM_FLAVOR=DISABLE \
-DSLANG_EMBED_STDLIB=1 \
-G 'Unix Makefiles'
# build the binary in docker image
- 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
cd build
make -j$(nproc)
- name: Package Slang
id: package
run: |
# 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.package.outputs.SLANG_BINARY_ARCHIVE_ZIP }}
${{ steps.package.outputs.SLANG_BINARY_ARCHIVE_TAR }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}