yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
fba75a6f3
master
1name : Regenerate Command Line Reference 2on : 3repository_dispatch : 4types : [ regenerate-cmdline-ref-command ] 5jobs : 6regenerate-cmdline-ref : 7runs-on : ubuntu-latest 8steps : 9- name : Checkout PR branch 10uses : actions/checkout@v4 11with : 12token : ${{ secrets.SLANGBOT_PAT }} 13repository : ${{ github.event.client_payload.pull_request.head.repo.full_name }} 14ref : ${{ github.event.client_payload.pull_request.head.ref }} 15path : pr-branch 16submodules : "recursive" 17 18- name : Checkout target branch 19uses : actions/checkout@v4 20with : 21token : ${{ secrets.SLANGBOT_PAT }} 22repository : ${{ github.event.client_payload.pull_request.base.repo.full_name }} 23ref : ${{ github.event.client_payload.pull_request.base.ref }} 24path : target-branch 25submodules : "recursive" 26 27- name : Install dependencies 28run : | 29sudo apt-get update 30sudo apt-get install -y libx11-dev 31 32- name : Setup 33uses : ./target-branch/.github/actions/common-setup 34with : 35os : linux 36compiler : gcc 37platform : x86_64 38config : release 39build-llvm : false 40 41- name : Build Slang 42id : build 43run : | 44cd pr-branch 45cmake --preset default --fresh \ 46-DSLANG_SLANG_LLVM_FLAVOR=DISABLE \ 47-DSLANG_ENABLE_TESTS=OFF \ 48-DSLANG_ENABLE_EXAMPLES=OFF \ 49-DSLANG_ENABLE_GFX=OFF \ 50-DSLANG_ENABLE_SLANGD=OFF \ 51-DSLANG_EXCLUDE_DAWN=ON \ 52-DSLANG_EXCLUDE_TINT=ON 53cmake --workflow --preset release 54 55- name : Regenerate Command Line Reference 56id : regen 57run : | 58cd pr-branch 59mkdir -p docs 60./build/${{ env.cmake_config }}/bin/slangc -help-style markdown -h > docs/command-line-slangc-reference.md 2>&1 61 62- name : Configure Git commit signing 63id : git-info 64run : | 65echo "${{ secrets.SLANGBOT_SIGNING_KEY }}" > "${{runner.temp}}"/signing_key 66chmod 600 "${{runner.temp}}"/signing_key 67git -C pr-branch config commit.gpgsign true 68git -C pr-branch config gpg.format ssh 69git -C pr-branch config user.signingkey "${{runner.temp}}"/signing_key 70bot_info=$(curl -s -H "Authorization: Bearer ${{ secrets.SLANGBOT_PAT }}" \ 71"https://api.github.com/user") 72echo "bot_identity=$(echo $bot_info | jq --raw-output '.login + " <" + (.id|tostring) + "+" + .login + "@users.noreply.github.com>"')" >> $GITHUB_OUTPUT 73echo "bot_name=$(echo $bot_info | jq --raw-output '.login')" >> $GITHUB_OUTPUT 74 75- name : Create Pull Request 76id : create-pr 77uses : peter-evans/create-pull-request@v7 78with : 79token : ${{ secrets.SLANGBOT_PAT }} 80path : pr-branch 81commit-message : "regenerate command line reference" 82title : "Regenerate command line reference for PR #${{ github.event.client_payload.pull_request.number }}" 83body : "Automated command line reference generation for ${{ github.event.client_payload.pull_request.html_url }}" 84committer : ${{ steps.git-info.outputs.bot_identity }} 85author : ${{ steps.git-info.outputs.bot_identity }} 86branch : regenerate-cmdline-ref-${{ github.event.client_payload.pull_request.number }}-${{ github.event.client_payload.pull_request.head.ref }} 87base : ${{ github.event.client_payload.pull_request.head.ref }} 88push-to-fork : ${{ steps.git-info.outputs.bot_name }}/slang 89delete-branch : true 90 91- name : Comment on PR 92uses : peter-evans/create-or-update-comment@v4 93if : always() 94with : 95token : ${{ secrets.SLANGBOT_PAT }} 96repository : ${{ github.event.client_payload.github.payload.repository.full_name }} 97issue-number : ${{ github.event.client_payload.pull_request.number }} 98body : | 99${{ 100steps.build.conclusion == 'failure' 101&& format('❌ Slang build failed. Please check the [workflow run](https://github.com/{0}/actions/runs/{1})', github.repository, github.run_id) 102|| (steps.regen.conclusion == 'failure' 103&& format('❌ Command line reference generation failed. Please check the [workflow run](https://github.com/{0}/actions/runs/{1})', github.repository, github.run_id) 104|| (steps.create-pr.conclusion == 'failure' 105&& format('❌ Failed to create regenerate command line reference pull request. Please check the [workflow run](https://github.com/{0}/actions/runs/{1})', github.repository, github.run_id) 106|| format('🌈 Regenerated command line reference, please merge the changes from [this PR]({0})', steps.create-pr.outputs.pull-request-url))) 107}} 108 109- name : Add reaction 110uses : peter-evans/create-or-update-comment@v4 111with : 112token : ${{ secrets.SLANGBOT_PAT }} 113repository : ${{ github.event.client_payload.github.payload.repository.full_name }} 114comment-id : ${{ github.event.client_payload.github.payload.comment.id }} 115reactions-edit-mode : replace 116reactions : hooray