Skip to content

Fix release creation not running because we don't name our default br… #38

Fix release creation not running because we don't name our default br…

Fix release creation not running because we don't name our default br… #38

Workflow file for this run

name: "Redpoint Games LLVM"
on:
push:
branches: [ "redpoint/*" ]
pull_request:
branches: [ "redpoint/*" ]
jobs:
get-branch-name:
name: "Get Branch Name"
runs-on: ubuntu-latest
outputs:
branch: ${{ steps.extract_branch.outputs.branch }}
steps:
- name: Checkout
uses: actions/checkout@v4
- id: extract_branch
name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/redpoint/}}" >> $GITHUB_OUTPUT
llvm-redpoint-linux:
name: "Build for Linux"
needs:
- get-branch-name
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Generate
run: |
mkdir -pv build/release/linux
cmake \
"-DLLVM_ENABLE_PROJECTS:STRING=clang;lld" \
-DLLVM_INSTALL_TOOLCHAIN_ONLY:BOOL=TRUE \
-DLLVM_INCLUDE_BENCHMARKS:BOOL=FALSE \
-DLLVM_INCLUDE_DOCS:BOOL=FALSE \
-DLLVM_INCLUDE_EXAMPLES:BOOL=FALSE \
-DLLVM_INCLUDE_TESTS:BOOL=FALSE \
-DCLANG_INCLUDE_TESTS:BOOL=FALSE \
-DCLANG_INCLUDE_DOCS:BOOL=FALSE \
-DLLVM_ENABLE_DIA_SDK:BOOL=FALSE \
-DCMAKE_BUILD_TYPE=Release \
-Hllvm -Bbuild/release/linux
- name: Build
run: |
cmake --build build/release/linux --config Release -j 20
- name: Install
run: |
cmake --install build/release/linux --config Release --prefix "/opt/llvm-redpoint" --strip
- name: "Prepare for Upload"
run: |
mv /opt/llvm-redpoint llvm-linux-${{ needs.get-branch-name.outputs.branch }}
zip -r llvm-linux-${{ needs.get-branch-name.outputs.branch }}.zip llvm-linux-${{ needs.get-branch-name.outputs.branch }}
- name: "Upload LLVM"
uses: actions/upload-artifact@v4
with:
name: llvm-linux-${{ needs.get-branch-name.outputs.branch }}
if-no-files-found: error
path: |
llvm-linux-${{ needs.get-branch-name.outputs.branch }}.zip
llvm-redpoint-windows:
name: "Build for Windows"
needs:
- get-branch-name
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Wix Toolset
shell: pwsh
run: |
dotnet tool install --global wix
if ($LastExitCode -ne 0) { exit $LastExitCode }
- name: Generate
shell: pwsh
run: |
mkdir build\release\win64
cmake -T host=x64 -A x64 `
"-DLLVM_ENABLE_PROJECTS:STRING=clang;lld" `
-DLLVM_INSTALL_TOOLCHAIN_ONLY:BOOL=TRUE `
-DLLVM_INCLUDE_BENCHMARKS:BOOL=FALSE `
-DLLVM_INCLUDE_DOCS:BOOL=FALSE `
-DLLVM_INCLUDE_EXAMPLES:BOOL=FALSE `
-DLLVM_INCLUDE_TESTS:BOOL=FALSE `
-DCLANG_INCLUDE_TESTS:BOOL=FALSE `
-DCLANG_INCLUDE_DOCS:BOOL=FALSE `
-DLLVM_ENABLE_DIA_SDK:BOOL=FALSE `
-DCMAKE_BUILD_TYPE=Release `
-Hllvm -Bbuild/release/win64
if ($LastExitCode -ne 0) { exit $LastExitCode }
- name: Build
shell: pwsh
run: |
cmake --build build/release/win64 --config Release -j 20
if ($LastExitCode -ne 0) { exit $LastExitCode }
- name: Install
shell: pwsh
run: |
if (Test-Path "C:\Program Files\LLVM") {
Remove-Item -Force -Recurse "C:\Program Files\LLVM"
}
cmake --install build/release/win64 --config Release --strip
if ($LastExitCode -ne 0) { exit $LastExitCode }
- name: "Generate MSI"
shell: pwsh
run: |
wix build .github\workflows\llvm.wxs
if ($LastExitCode -ne 0) { exit $LastExitCode }
- name: "Prepare for Upload"
shell: pwsh
run: |
Move-Item -Force "C:\Program Files\LLVM" llvm-win64-${{ needs.get-branch-name.outputs.branch }}
Compress-Archive -Force -Path "llvm-win64-${{ needs.get-branch-name.outputs.branch }}" -DestinationPath "llvm-win64-${{ needs.get-branch-name.outputs.branch }}.zip"
- name: "Upload LLVM ZIP"
uses: actions/upload-artifact@v4
with:
name: llvm-win64-${{ needs.get-branch-name.outputs.branch }}
if-no-files-found: error
path: |
llvm-win64-${{ needs.get-branch-name.outputs.branch }}.zip
- name: "Upload LLVM MSI"
uses: actions/upload-artifact@v4
with:
name: llvm-win64-msi-${{ needs.get-branch-name.outputs.branch }}
if-no-files-found: error
path: |
.github/workflows/llvm.msi
create-release:
name: "Create Release"
needs:
- llvm-redpoint-linux
- llvm-redpoint-windows
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
steps:
- name: Publish Release
uses: ncipollo/release-action@v1
with:
artifacts: "llvm-linux-${{ needs.get-branch-name.outputs.branch }},llvm-win64-${{ needs.get-branch-name.outputs.branch }}"
artifactErrorsFailBuild: true
artifactContentType: "application/zip"
tag: "${{ needs.get-branch-name.outputs.branch }}-${{ env.GITHUB_SHA }}"
commit: ${{ env.GITHUB_SHA }}
body: This release for Clang ${{ needs.get-branch-name.outputs.branch }} was automatically created from a successful build.
generateReleaseNotes: true