yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Jay KwakRestrict the release tag name to a pattern the build script expects (#8027)a660640d4

master
2.2 KiB59 linesraw
1on:
2  workflow_dispatch:
3  push:
4    tags:
5      - "v20[2-9][0-9].[0-9]*"
6
7name: ubuntu18-gcc11 Release
8jobs:
9  build:
10    runs-on: ubuntu-22.04
11    steps:
12      - uses: actions/checkout@v4
13        with:
14          submodules: "recursive"
15          fetch-depth: "0"
16
17      # build the binary in docker image
18      - name: Run the build process with Docker
19        uses: addnab/docker-run-action@v3
20        with:
21          # TODO: Move the image to a more appropriate registry
22          image: gztong/ubuntu18-gcc11:glibc2.28
23          options: -v ${{ github.workspace }}:/home/app -v /etc/ssl/certs/ca-certificates.crt:/etc/ssl/certs/ca-certificates.crt
24          run: |
25            export PATH=/opt/cmake-3.25.0-linux-x86_64/bin:$PATH
26            cd /home/app
27            git config --global --add safe.directory /home/app
28            cmake --preset default --fresh -DSLANG_SLANG_LLVM_FLAVOR=DISABLE
29            cmake --build --preset release -j $(nproc)
30            cpack --preset release -G ZIP
31            cpack --preset release -G TGZ
32      - name: Package Slang
33        id: package
34        run: |
35          triggering_ref=${{ github.ref_name }}
36          if [[ $triggering_ref =~ ^v[0-9] ]]; then
37            version=${triggering_ref#v}
38          else
39            version=$triggering_ref
40          fi
41          base=$(pwd)/slang-${version}-linux-x86_64-glibc-2.27
42          sudo mv "$(pwd)/build/dist-release/slang.zip" "${base}.zip"
43          echo "SLANG_BINARY_ARCHIVE_ZIP=${base}.zip" >> "$GITHUB_OUTPUT"
44          sudo mv "$(pwd)/build/dist-release/slang.tar.gz" "${base}.tar.gz"
45          echo "SLANG_BINARY_ARCHIVE_TAR=${base}.tar.gz" >> "$GITHUB_OUTPUT"
46      - name: File check
47        run: |
48          find "build/dist-release" -print0 ! -iname '*.md' ! -iname '*.h' -type f | xargs -0 file
49      - name: UploadBinary
50        uses: softprops/action-gh-release@v1
51        if: startsWith(github.ref, 'refs/tags/v')
52        with:
53          draft: ${{contains(github.ref, 'draft')}}
54          prerelease: ${{contains(github.ref, 'draft')}}
55          files: |
56            ${{ steps.package.outputs.SLANG_BINARY_ARCHIVE_ZIP }}
57            ${{ steps.package.outputs.SLANG_BINARY_ARCHIVE_TAR }}
58        env:
59          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}