|
| 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 Release |
| 8 | +jobs: |
| 9 | + build: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + steps: |
| 12 | + - name: Check out the repo |
| 13 | + uses: actions/checkout@v2 |
| 14 | + with: |
| 15 | + submodules: 'true' |
| 16 | + fetch-depth: '0' |
| 17 | + |
| 18 | + - name: build docker image |
| 19 | + run: docker build -t ubuntu-18.04-gcc-9 ./.github/workflows/dockerfiles/ubuntu-18.04-x64 |
| 20 | + |
| 21 | + # build the binary in docker image |
| 22 | + - name: Run the build process with Docker |
| 23 | + uses: addnab/docker-run-action@v3 |
| 24 | + with: |
| 25 | + image: ubuntu-18.04-gcc-9 |
| 26 | + options: -v ${{ github.workspace }}:/home/app |
| 27 | + run: | |
| 28 | + cd /home/app |
| 29 | + git config --global --add safe.directory /home/app |
| 30 | + export CC=gcc |
| 31 | + export CONFIGURATION=release |
| 32 | + export ARCH=x64 |
| 33 | + export TARGETARCH=x64 |
| 34 | + export TARGETARCH=x64 |
| 35 | + export GLIBC_COMPATIBLE=1 |
| 36 | + /bin/bash ./github_build.sh |
| 37 | +
|
| 38 | + - name: CreatePackages |
| 39 | + id: build |
| 40 | + run: | |
| 41 | + echo "creating binary archieves..." |
| 42 | + export SLANG_OS_NAME=linux |
| 43 | + export SLANG_ARCH_NAME=`uname -p` |
| 44 | + export TAG_NAME=`git describe --tags` |
| 45 | + export SLANG_TAG=${TAG_NAME#v} |
| 46 | + echo "tag:$TAG_NAME" |
| 47 | + echo "slang-tag:$SLANG_TAG" |
| 48 | + export SLANG_BINARY_ARCHIVE=slang-${SLANG_TAG}-${SLANG_OS_NAME}-${SLANG_ARCH_NAME}-glibc-2.27.zip |
| 49 | + export SLANG_BINARY_ARCHIVE_TAR=slang-${SLANG_TAG}-${SLANG_OS_NAME}-${SLANG_ARCH_NAME}-glibc-2.27.tar.gz |
| 50 | + echo "creating zip" |
| 51 | + 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 |
| 52 | + echo "creating tar" |
| 53 | + 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 |
| 54 | + echo "SLANG_BINARY_ARCHIVE=${SLANG_BINARY_ARCHIVE}" >> $GITHUB_OUTPUT |
| 55 | + echo "SLANG_BINARY_ARCHIVE_TAR=${SLANG_BINARY_ARCHIVE_TAR}" >> $GITHUB_OUTPUT |
| 56 | + - name: UploadBinary |
| 57 | + uses: softprops/action-gh-release@v1 |
| 58 | + with: |
| 59 | + files: | |
| 60 | + ${{ steps.build.outputs.SLANG_BINARY_ARCHIVE }} |
| 61 | + ${{ steps.build.outputs.SLANG_BINARY_ARCHIVE_TAR }} |
| 62 | + env: |
| 63 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments