ubuntu18-gcc11 Release #315
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| on: | |
| workflow_dispatch: | |
| push: | |
| tags: | |
| - "v20[2-9][0-9].[0-9]*" | |
| schedule: | |
| # Run nightly at 2 AM UTC | |
| - cron: "0 2 * * *" | |
| name: ubuntu18-gcc11 Release | |
| jobs: | |
| build: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: "recursive" | |
| fetch-depth: "0" | |
| fetch-tags: true | |
| # build the binary in docker image | |
| - name: Run the build process with Docker | |
| run: | | |
| docker run --rm \ | |
| -v ${{ github.workspace }}:/home/app \ | |
| -v /etc/ssl/certs/ca-certificates.crt:/etc/ssl/certs/ca-certificates.crt \ | |
| gztong/ubuntu18-gcc11:glibc2.28 \ | |
| bash -euo pipefail -c ' | |
| export PATH=/opt/cmake-3.25.0-linux-x86_64/bin:$PATH | |
| cd /home/app | |
| git config --global --add safe.directory /home/app | |
| cmake --preset default --fresh -DSLANG_SLANG_LLVM_FLAVOR=DISABLE | |
| cmake --build --preset release -j $(nproc) | |
| cpack --preset release -G ZIP | |
| cpack --preset release -G TGZ | |
| ' | |
| - name: Package Slang | |
| id: package | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| run: | | |
| triggering_ref=${{ github.ref_name }} | |
| if [[ $triggering_ref =~ ^v[0-9] ]]; then | |
| version=${triggering_ref#v} | |
| else | |
| version=$triggering_ref | |
| fi | |
| # Sanitize version for use in filenames (replace path separators) | |
| version=${version//\//-} | |
| base=$(pwd)/slang-${version}-linux-x86_64-glibc-2.27 | |
| sudo mv "$(pwd)/build/dist-release/slang.zip" "${base}.zip" | |
| echo "SLANG_BINARY_ARCHIVE_ZIP=${base}.zip" >> "$GITHUB_OUTPUT" | |
| sudo mv "$(pwd)/build/dist-release/slang.tar.gz" "${base}.tar.gz" | |
| echo "SLANG_BINARY_ARCHIVE_TAR=${base}.tar.gz" >> "$GITHUB_OUTPUT" | |
| - name: File check | |
| run: | | |
| find "build/dist-release" -print0 ! -iname '*.md' ! -iname '*.h' -type f | xargs -0 file | |
| - name: UploadBinary | |
| uses: softprops/action-gh-release@v1 | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| with: | |
| draft: ${{contains(github.ref, 'draft')}} | |
| prerelease: ${{contains(github.ref, 'draft')}} | |
| files: | | |
| ${{ steps.package.outputs.SLANG_BINARY_ARCHIVE_ZIP }} | |
| ${{ steps.package.outputs.SLANG_BINARY_ARCHIVE_TAR }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |