Skip to content

chore(master): release 0.4.0 #51

chore(master): release 0.4.0

chore(master): release 0.4.0 #51

Workflow file for this run

name: Release
on:
push:
branches: [master]
permissions:
contents: write
pull-requests: write
env:
CARGO_TERM_COLOR: always
jobs:
release-please:
runs-on: ubuntu-latest
outputs:
releases_created: ${{ steps.release.outputs.releases_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.APP_KEY }}
- uses: googleapis/release-please-action@v4
id: release
with:
token: ${{ steps.app-token.outputs.token }}
build:
needs: release-please
if: ${{ needs.release-please.outputs.releases_created == 'true' }}
timeout-minutes: 45
# DLSS is built for the RTX-capable desktop targets only. macOS cannot
# compile it (no Vulkan backend / NVIDIA RTX), so it stays DLSS-free.
env:
DLSS_VERSION: "310.5.3"
VULKAN_HEADERS_TAG: vulkan-sdk-1.4.313.0
strategy:
fail-fast: false
matrix:
include:
- name: linux-x86_64
os: ubuntu-latest
target: x86_64-unknown-linux-gnu
dlss: true
- name: macos-aarch64
os: macos-14
target: aarch64-apple-darwin
- name: windows-x86_64
os: windows-latest
target: x86_64-pc-windows-msvc
dlss: true
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install Linux system dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
pkg-config \
libasound2-dev \
libudev-dev \
libwayland-dev \
libxkbcommon-dev \
libx11-dev \
libxcursor-dev \
libxrandr-dev \
libxi-dev \
libgl1-mesa-dev \
clang \
libclang-dev
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
# dlss_wgpu links the DLSS SDK statically and parses the Vulkan headers
# with bindgen at build time (Vulkan itself is loaded at runtime via ash,
# so only the headers are needed here). The SDK is not redistributable,
# so it is cloned fresh from NVIDIA's public repo on each build.
- name: Set up DLSS build environment
if: matrix.dlss
shell: bash
run: |
git clone --depth 1 --branch "v${DLSS_VERSION}" \
https://github.com/NVIDIA/DLSS.git "${RUNNER_TEMP}/DLSS"
git clone --depth 1 --branch "${VULKAN_HEADERS_TAG}" \
https://github.com/KhronosGroup/Vulkan-Headers.git "${RUNNER_TEMP}/Vulkan-Headers"
echo "DLSS_SDK=${RUNNER_TEMP}/DLSS" >> "$GITHUB_ENV"
echo "VULKAN_SDK=${RUNNER_TEMP}/Vulkan-Headers" >> "$GITHUB_ENV"
- name: Configure libclang (Windows)
if: matrix.dlss && runner.os == 'Windows'
shell: bash
run: echo 'LIBCLANG_PATH=C:\Program Files\LLVM\bin' >> "$GITHUB_ENV"
- name: Cache cargo
uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.target }}
- name: Build
env:
LIFTHRASIR_VERSION: ${{ needs.release-please.outputs.tag_name }}
run: >
cargo build -p lifthrasir
--profile dist
--no-default-features
--locked
--target ${{ matrix.target }}
${{ matrix.dlss && '--features dlss' || '' }}
- name: Package (unix)
if: runner.os != 'Windows'
shell: bash
run: |
staging="lifthrasir-${{ needs.release-please.outputs.tag_name }}-${{ matrix.name }}"
mkdir -p "$staging"
cp "target/${{ matrix.target }}/dist/lifthrasir" "$staging/"
cp -r assets "$staging/"
cp README.md LICENSE "$staging/"
if [ "${{ matrix.dlss }}" = "true" ]; then
cp "$DLSS_SDK/lib/Linux_x86_64/rel/libnvidia-ngx-dlss.so.${DLSS_VERSION}" "$staging/"
cp "$DLSS_SDK/LICENSE.txt" "$staging/DLSS-LICENSE.txt"
fi
tar -czf "$staging.tar.gz" "$staging"
echo "ASSET=$staging.tar.gz" >> "$GITHUB_ENV"
- name: Package (windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$staging = "lifthrasir-${{ needs.release-please.outputs.tag_name }}-${{ matrix.name }}"
New-Item -ItemType Directory -Force -Path $staging | Out-Null
Copy-Item "target/${{ matrix.target }}/dist/lifthrasir.exe" "$staging/"
Copy-Item -Recurse assets "$staging/assets"
Copy-Item README.md, LICENSE "$staging/"
if ("${{ matrix.dlss }}" -eq "true") {
Copy-Item "$env:DLSS_SDK/lib/Windows_x86_64/rel/nvngx_dlss.dll" "$staging/"
Copy-Item "$env:DLSS_SDK/LICENSE.txt" "$staging/DLSS-LICENSE.txt"
}
Compress-Archive -Path $staging -DestinationPath "$staging.zip"
"ASSET=$staging.zip" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.name }}
path: ${{ env.ASSET }}
if-no-files-found: error
upload:
needs: [release-please, build]
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.APP_KEY }}
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- name: Upload to release
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
run: gh release upload "${{ needs.release-please.outputs.tag_name }}" artifacts/* --clobber --repo ${{ github.repository }}
notify-discord:
needs: [release-please, upload]
runs-on: ubuntu-latest
steps:
- name: Get release notes
id: release_notes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
BODY=$(gh release view "${{ needs.release-please.outputs.tag_name }}" \
--repo ${{ github.repository }} \
--json body -q .body)
# Truncate to 4000 chars to stay within Discord embed limits
echo "body<<EOF" >> "$GITHUB_OUTPUT"
echo "${BODY:0:4000}" >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"
- name: Post to Discord
env:
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_RELEASE_WEBHOOK }}
run: |
curl -s -X POST "$DISCORD_WEBHOOK_URL" \
-H "Content-Type: application/json" \
-d '{
"embeds": [{
"title": "🚀 Lifthrasir ${{ needs.release-please.outputs.tag_name }} released",
"description": ${{ toJSON(steps.release_notes.outputs.body) }},
"color": 5814783,
"url": "https://github.com/${{ github.repository }}/releases/tag/${{ needs.release-please.outputs.tag_name }}",
"footer": { "text": "GitHub Actions" }
}]
}'