mirror of
https://github.com/Toastconcern/FrameStudio.git
synced 2026-10-29 04:02:56 +01:00
ci: Add caching for builds, prevent nested archives
Also add title and description to actions Move the FrameHome build-info.txt artifact to the build stage, since it's not needed for the release. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
4 files changed
+190
-58
No files matched your search
+145
-33
@@ -37,9 +37,29 @@ jobs:
|
||||
- { arch: arm64, runner: ubuntu-24.04-arm, extra: "" }
|
||||
runs-on: ${{ matrix.runner }}
|
||||
timeout-minutes: 45
|
||||
env:
|
||||
FRAME_USE_CCACHE: "1"
|
||||
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
||||
CCACHE_MAXSIZE: 500M
|
||||
CCACHE_COMPILERCHECK: content
|
||||
APT_CACHE_DIR: ${{ github.workspace }}/.apt-cache
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/download-artifact@v4
|
||||
- name: Check out source
|
||||
uses: actions/checkout@v4
|
||||
- name: Restore compiler cache
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: ${{ github.workspace }}/.ccache
|
||||
key: ccache-studio-linux-${{ matrix.arch }}-${{ github.sha }}
|
||||
restore-keys: ccache-studio-linux-${{ matrix.arch }}-
|
||||
- name: Restore apt package cache
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: .apt-cache/archives
|
||||
key: apt-ubuntu-24.04-${{ matrix.arch }}-${{ hashFiles('.github/workflows/build.yml') }}
|
||||
restore-keys: apt-ubuntu-24.04-${{ matrix.arch }}-
|
||||
- name: Download Frame Home payload
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: FrameHome-payload
|
||||
path: build/frame-home/payload
|
||||
@@ -47,14 +67,20 @@ jobs:
|
||||
run: |
|
||||
# x86 links against 32-bit X11, so apt needs the i386 packages too
|
||||
if [ "${{ matrix.i386 }}" = "true" ]; then sudo dpkg --add-architecture i386; fi
|
||||
sudo mkdir -p "$APT_CACHE_DIR/archives/partial"
|
||||
sudo chown _apt:root "$APT_CACHE_DIR/archives/partial"
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y ninja-build cmake libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxkbcommon-dev ${{ matrix.extra }}
|
||||
sudo apt-get -o Dir::Cache::archives="$APT_CACHE_DIR/archives" install -y ccache ninja-build cmake libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxkbcommon-dev ${{ matrix.extra }}
|
||||
sudo chown -R "$(id -u):$(id -g)" "$APT_CACHE_DIR/archives"
|
||||
- name: Build
|
||||
run: sh scripts/build-studio.sh linux-${{ matrix.arch }}
|
||||
- uses: actions/upload-artifact@v4
|
||||
- name: Show compiler cache statistics
|
||||
run: ccache --show-stats
|
||||
- name: Upload Linux build
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: FrameStudio-linux-${{ matrix.arch }}
|
||||
path: dist/FrameStudio-linux-${{ matrix.arch }}.tar.gz
|
||||
path: build/stage/FrameStudio-linux-${{ matrix.arch }}
|
||||
|
||||
windows:
|
||||
name: Windows ${{ matrix.arch }}
|
||||
@@ -66,8 +92,10 @@ jobs:
|
||||
runs-on: windows-latest
|
||||
timeout-minutes: 45
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/download-artifact@v4
|
||||
- name: Check out source
|
||||
uses: actions/checkout@v4
|
||||
- name: Download Frame Home payload
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: FrameHome-payload
|
||||
path: build/frame-home/payload
|
||||
@@ -83,12 +111,11 @@ jobs:
|
||||
Copy-Item "build/windows-${{ matrix.arch }}/Frame Studio.exe" $stage
|
||||
Copy-Item -Recurse "build/windows-${{ matrix.arch }}/frame" "$stage/frame"
|
||||
Copy-Item LICENSE "$stage/LICENSE.txt"
|
||||
New-Item -ItemType Directory -Force dist | Out-Null
|
||||
Compress-Archive -Path $stage -DestinationPath "dist/$name.zip" -Force
|
||||
- uses: actions/upload-artifact@v4
|
||||
- name: Upload Windows build
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: FrameStudio-windows-${{ matrix.arch }}
|
||||
path: dist/FrameStudio-windows-${{ matrix.arch }}.zip
|
||||
path: build/stage/FrameStudio-windows-${{ matrix.arch }}
|
||||
|
||||
macos:
|
||||
name: macOS ${{ matrix.arch }}
|
||||
@@ -103,47 +130,89 @@ jobs:
|
||||
- { arch: x64, runner: macos-15-intel }
|
||||
runs-on: ${{ matrix.runner }}
|
||||
timeout-minutes: 45
|
||||
env:
|
||||
FRAME_USE_CCACHE: "1"
|
||||
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
||||
CCACHE_MAXSIZE: 500M
|
||||
CCACHE_COMPILERCHECK: content
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/download-artifact@v4
|
||||
- name: Check out source
|
||||
uses: actions/checkout@v4
|
||||
- name: Restore compiler cache
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: ${{ github.workspace }}/.ccache
|
||||
key: ccache-studio-macos-${{ matrix.arch }}-${{ github.sha }}
|
||||
restore-keys: ccache-studio-macos-${{ matrix.arch }}-
|
||||
- name: Restore Homebrew package cache
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: ~/Library/Caches/Homebrew/downloads
|
||||
key: brew-macos-${{ matrix.arch }}-${{ hashFiles('.github/workflows/build.yml') }}
|
||||
restore-keys: brew-macos-${{ matrix.arch }}-
|
||||
- name: Download Frame Home payload
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: FrameHome-payload
|
||||
path: build/frame-home/payload
|
||||
- name: Tools and MoltenVK (Vulkan on Metal, bundled into the app)
|
||||
run: brew install ninja molten-vk
|
||||
run: brew install ccache ninja molten-vk
|
||||
- name: Build
|
||||
run: sh scripts/build-studio.sh macos-${{ matrix.arch }}
|
||||
- uses: actions/upload-artifact@v4
|
||||
- name: Show compiler cache statistics
|
||||
run: ccache --show-stats
|
||||
- name: Upload macOS build
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: FrameStudio-macos-${{ matrix.arch }}
|
||||
path: dist/FrameStudio-macos-${{ matrix.arch }}.zip
|
||||
path: build/stage/FrameStudio-macos-${{ matrix.arch }}
|
||||
|
||||
frame-home:
|
||||
name: Build Frame Home payload
|
||||
runs-on: ubuntu-24.04-arm
|
||||
timeout-minutes: 45
|
||||
env:
|
||||
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
||||
CCACHE_MAXSIZE: 500M
|
||||
CCACHE_COMPILERCHECK: content
|
||||
APT_CACHE_DIR: ${{ github.workspace }}/.apt-cache
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Check out source
|
||||
uses: actions/checkout@v4
|
||||
- name: Restore compiler cache
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: ${{ github.workspace }}/.ccache
|
||||
key: ccache-frame-home-arm64-${{ github.sha }}
|
||||
restore-keys: ccache-frame-home-arm64-
|
||||
- name: Restore apt package cache
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: .apt-cache/archives
|
||||
key: apt-ubuntu-24.04-arm64-${{ hashFiles('.github/workflows/build.yml') }}
|
||||
restore-keys: apt-ubuntu-24.04-arm64-
|
||||
- name: Install Frame Home build dependencies
|
||||
run: |
|
||||
set -euo pipefail
|
||||
sudo mkdir -p "$APT_CACHE_DIR/archives/partial"
|
||||
sudo chown _apt:root "$APT_CACHE_DIR/archives/partial"
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y cmake ninja-build gcc-13 g++-13 glslc zip
|
||||
sudo apt-get -o Dir::Cache::archives="$APT_CACHE_DIR/archives" install -y ccache cmake ninja-build gcc-13 g++-13 glslc zip
|
||||
sudo chown -R "$(id -u):$(id -g)" "$APT_CACHE_DIR/archives"
|
||||
- name: Build payload and installer
|
||||
run: sh scripts/build-frame-home.sh --ci
|
||||
- uses: actions/upload-artifact@v4
|
||||
- name: Show compiler cache statistics
|
||||
run: ccache --show-stats
|
||||
- name: Upload Frame Home payload
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: FrameHome-payload
|
||||
path: build/frame-home/payload
|
||||
- uses: actions/upload-artifact@v4
|
||||
- name: Upload Frame Home installer
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: FrameHome-installer
|
||||
path: build/frame-home/FrameHome-installer.zip
|
||||
if-no-files-found: error
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: FrameHome-build-info
|
||||
path: build/frame-home/build-info.txt
|
||||
path: build/frame-home/FrameHome-installer-stage/FrameHome-installer
|
||||
if-no-files-found: error
|
||||
release:
|
||||
name: Publish
|
||||
@@ -163,19 +232,60 @@ jobs:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
REPO: ${{ github.repository }}
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
- name: Download Studio build artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
pattern: FrameStudio-*
|
||||
path: dist
|
||||
merge-multiple: true
|
||||
- uses: actions/download-artifact@v4
|
||||
merge-multiple: false
|
||||
- name: Download Frame Home payload
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: FrameHome-payload
|
||||
path: ${{ runner.temp }}/frame-home-payload
|
||||
- uses: actions/download-artifact@v4
|
||||
- name: Download Frame Home installer
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: FrameHome-installer
|
||||
path: dist
|
||||
path: dist/FrameHome-installer
|
||||
- name: Rebuild release archives
|
||||
run: |
|
||||
for package in dist/FrameStudio-linux-*; do
|
||||
[ -d "$package" ] || continue
|
||||
name=${package##*/}
|
||||
if [ -d "$package/frame/bin" ]; then
|
||||
chmod +x "$package/frame/install.sh" "$package/frame/bin/"*
|
||||
fi
|
||||
tar -czf "dist/$name.tar.gz" -C dist "$name"
|
||||
rm -rf "$package"
|
||||
done
|
||||
for package in dist/FrameStudio-windows-* dist/FrameStudio-macos-*; do
|
||||
[ -d "$package" ] || continue
|
||||
name=${package##*/}
|
||||
if [ -d "$package/frame/bin" ]; then
|
||||
chmod +x "$package/frame/install.sh" "$package/frame/bin/"*
|
||||
fi
|
||||
if [[ "$name" == FrameStudio-macos-* ]]; then
|
||||
chmod +x "$package/Frame Studio.app/Contents/MacOS/Frame Studio"
|
||||
fi
|
||||
(cd dist && zip -qr "$name.zip" "$name")
|
||||
rm -rf "$package"
|
||||
done
|
||||
chmod +x dist/FrameHome-installer/install-frame-home.sh \\
|
||||
dist/FrameHome-installer/payload/install.sh \\
|
||||
dist/FrameHome-installer/payload/bin/*
|
||||
(cd dist && zip -qr FrameHome-installer.zip FrameHome-installer)
|
||||
rm -rf dist/FrameHome-installer
|
||||
python3 - <<'PY'
|
||||
from pathlib import Path
|
||||
from zipfile import ZipFile
|
||||
|
||||
for path in Path("dist").glob("*.zip"):
|
||||
with ZipFile(path) as archive:
|
||||
nested = [name for name in archive.namelist() if name.lower().endswith(".zip")]
|
||||
if nested:
|
||||
raise SystemExit(f"{path} contains nested ZIP files: {nested}")
|
||||
PY
|
||||
# What Frame Studio (studio/updater.h) and the headset's Environments panel check for updates: this commit,
|
||||
# Frame Home's identity (a hash of the headset programs, the same one the panel works out for what's installed)
|
||||
# and the files in this release.
|
||||
@@ -185,10 +295,12 @@ jobs:
|
||||
files=$(ls dist | python3 -c 'import json, sys; print(json.dumps([l.strip() for l in sys.stdin if l.strip()]))')
|
||||
printf '{"build": "%s", "home": "%s", "date": "%s", "files": %s}\n' "$GITHUB_SHA" "$home" "$(date -u +%Y-%m-%dT%H:%M:%SZ)" "$files" > dist/latest.json
|
||||
cat dist/latest.json
|
||||
- uses: actions/attest-build-provenance@v2
|
||||
- name: Attest Studio release archives
|
||||
uses: actions/attest-build-provenance@v2
|
||||
with:
|
||||
subject-path: dist/FrameStudio-*
|
||||
- uses: actions/attest-build-provenance@v2
|
||||
- name: Attest Frame Home installer
|
||||
uses: actions/attest-build-provenance@v2
|
||||
with:
|
||||
subject-path: dist/FrameHome-installer.zip
|
||||
- name: Version release (tag v*)
|
||||
|
||||
Reference in new issue
Block a user