Skip to content

Commit 851b765

Browse files
authored
Upgrades to vulkan arm build (#9)
1 parent 99b320c commit 851b765

File tree

1 file changed

+61
-16
lines changed

1 file changed

+61
-16
lines changed
Lines changed: 61 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
name: Build-Vulkan-SDK-ARM
22

3+
env:
4+
DEFAULT_VULKAN_SDK_VERSION: '1.4.321.1'
5+
36
on:
4-
push:
5-
branches:
6-
- main
77
pull_request:
88
branches:
99
- main
1010
workflow_dispatch:
1111
inputs:
1212
version:
13-
description: 'Vulkan SDK version (e.g., 1.4.304.1)'
13+
description: 'Vulkan SDK version (e.g., 1.4.321.1)'
1414
required: false
15-
default: '1.4.304.1'
1615

1716
jobs:
1817
build-linux-arm:
@@ -28,13 +27,10 @@ jobs:
2827
- name: Set version variable
2928
id: vars
3029
run: |
31-
if [[ "${{ github.event.inputs.version }}" == "latest" || -z "${{ github.event.inputs.version }}" ]]; then
32-
echo "SDK_URL=https://sdk.lunarg.com/sdk/download/latest/linux/vulkan-sdk.tar.xz" >> $GITHUB_ENV
33-
echo "Using default SDK version: latest"
34-
else
35-
echo "SDK_URL=https://sdk.lunarg.com/sdk/download/${{ github.event.inputs.version }}/linux/vulkansdk-linux-arm64-${{ github.event.inputs.version }}.tar.xz" >> $GITHUB_ENV
36-
echo "Using specified SDK version: ${{ github.event.inputs.version }}"
37-
fi
30+
VERSION=${{ github.event.inputs.version || env.DEFAULT_VULKAN_SDK_VERSION }}
31+
echo "VERSION=${VERSION}" >> $GITHUB_ENV
32+
echo "SDK_URL=https://sdk.lunarg.com/sdk/download/${VERSION}/linux/vulkan-sdk.tar.xz" >> $GITHUB_ENV
33+
echo "Using specified SDK version: ${VERSION}"
3834
3935
- name: Update APT
4036
run: sudo apt update
@@ -63,7 +59,7 @@ jobs:
6359

6460
- name: Extract SDK and Determine SDK Directory
6561
run: |
66-
tar -xJf vulkan-sdk.tar.xz
62+
tar -xf vulkan-sdk.tar.xz
6763
SDK_DIR=$(find . -maxdepth 1 -type d -name '1.*' | head -n 1)
6864
echo "SDK_DIR=${SDK_DIR}" >> $GITHUB_ENV
6965
echo "SDK_VERSION=$(basename ${SDK_DIR})" >> $GITHUB_ENV
@@ -81,10 +77,59 @@ jobs:
8177
elif [[ "${{ matrix.os }}" == "ubuntu-24.04-arm" ]]; then
8278
CC=/usr/bin/gcc-14 CXX=/usr/bin/g++-14 ./vulkansdk --maxjobs vulkan-loader vulkan-validationlayers vulkan-extensionlayer
8379
fi
80+
tar -cJf ../vulkansdk-${{ matrix.os }}-${{ env.SDK_VERSION }}.tar.xz .
8481
85-
# When an Artifact is uploaded, all the files are assembled into an immutable Zip archive. There is currently no way to download artifacts in a format other than a Zip or to download individual artifact contents.
8682
- name: Upload Artifacts
8783
uses: actions/upload-artifact@v4
8884
with:
89-
name: vulkansdk-linux-arm64-${{ matrix.os }}-${{ env.SDK_VERSION }}
90-
path: ${{ env.SDK_VERSION }}
85+
name: vulkansdk-${{ matrix.os }}-${{ env.SDK_VERSION }}
86+
path: vulkansdk-${{ matrix.os }}-${{ env.SDK_VERSION }}.tar.xz
87+
88+
release:
89+
name: Publish release
90+
runs-on: ubuntu-22.04
91+
needs: build-linux-arm
92+
permissions:
93+
contents: write
94+
steps:
95+
- name: Download all assets
96+
uses: actions/download-artifact@v4
97+
with:
98+
path: dist
99+
100+
- name: List assets
101+
run: ls -R dist
102+
103+
- name: Set tag name
104+
id: set_tag
105+
run: |
106+
# Get current date/time in UTC, format YYYYMMDDHHMM
107+
DATE=$(date -u +'%Y%m%d%H%M')
108+
VERSION="${{ github.event.inputs.version || env.DEFAULT_VULKAN_SDK_VERSION }}"
109+
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
110+
echo "tag=vulkan-sdk-${VERSION}-${DATE}" >> $GITHUB_OUTPUT
111+
else
112+
PR_BRANCH="${{ github.head_ref }}"
113+
PR_BRANCH_CLEAN=$(echo "$PR_BRANCH" | tr '/' '-' | tr -cd '[:alnum:]-')
114+
echo "tag=vulkan-sdk-${VERSION}-${PR_BRANCH_CLEAN}-${DATE}" >> $GITHUB_OUTPUT
115+
fi
116+
117+
- name: Set prerelease flag
118+
id: set_prerelease
119+
run: |
120+
if [[ "${{ github.ref_name }}" == "main" ]]; then
121+
echo "is_prerelease=false" >> $GITHUB_OUTPUT
122+
else
123+
echo "is_prerelease=true" >> $GITHUB_OUTPUT
124+
fi
125+
126+
- name: Create/Update release
127+
uses: softprops/action-gh-release@v2
128+
with:
129+
tag_name: ${{ steps.set_tag.outputs.tag }}
130+
prerelease: ${{ steps.set_prerelease.outputs.is_prerelease }}
131+
name: ${{ steps.set_tag.outputs.tag }}
132+
body: |
133+
Vulkan SDK build for GsTaichi.
134+
files: |
135+
dist/**

0 commit comments

Comments
 (0)