ci: move snap build to separate workflow (#8405)

pull/8557/head
Mitchell Hashimoto 2025-09-07 07:55:25 -07:00 committed by GitHub
commit c0b9bf77f0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 66 additions and 39 deletions

53
.github/workflows/snap.yml vendored Normal file
View File

@ -0,0 +1,53 @@
on:
workflow_dispatch:
inputs:
source-tarball-id:
description: source tarball built during build-dist
required: true
type: string
name: Snap
jobs:
build:
strategy:
fail-fast: false
matrix:
os:
[namespace-profile-ghostty-snap, namespace-profile-ghostty-snap-arm64]
runs-on: ${{ matrix.os }}
timeout-minutes: 45
env:
ZIG_LOCAL_CACHE_DIR: /zig/local-cache
ZIG_GLOBAL_CACHE_DIR: /zig/global-cache
steps:
- name: Download Source Tarball Artifacts
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
with:
artifact-ids: ${{ inputs.source-tarball-id }}
- name: Extract tarball
run: |
mkdir dist
tar --verbose --extract --strip-components 1 --directory dist --file ghostty-source.tar.gz
- name: Setup Cache
uses: namespacelabs/nscloud-cache-action@305bfa7ea980a858d511af4899414a84847c7991 # v1.2.16
with:
path: |
/nix
/zig
- run: sudo apt install -y udev
- run: sudo systemctl start systemd-udevd
# Workaround until this is fixed: https://github.com/canonical/lxd-pkg-snap/pull/789
- run: |
_LXD_SNAP_DEVCGROUP_CONFIG="/var/lib/snapd/cgroup/snap.lxd.device"
sudo mkdir -p /var/lib/snapd/cgroup
echo 'self-managed=true' | sudo tee "${_LXD_SNAP_DEVCGROUP_CONFIG}"
- uses: snapcore/action-build@3bdaa03e1ba6bf59a65f84a751d943d549a54e79 # v1.3.0
with:
path: dist

View File

@ -17,7 +17,6 @@ jobs:
- build-linux
- build-linux-libghostty
- build-nix
- build-snap
- build-macos
- build-macos-matrix
- build-windows
@ -234,6 +233,8 @@ jobs:
build-dist:
runs-on: namespace-profile-ghostty-md
needs: test
outputs:
artifact-id: ${{ steps.upload-artifact.outputs.artifact-id }}
env:
ZIG_LOCAL_CACHE_DIR: /zig/local-cache
ZIG_GLOBAL_CACHE_DIR: /zig/global-cache
@ -264,12 +265,23 @@ jobs:
cp zig-out/dist/*.tar.gz ghostty-source.tar.gz
- name: Upload artifact
id: upload-artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: source-tarball
path: |-
ghostty-source.tar.gz
trigger-snap:
runs-on: namespace-profile-ghostty-xsm
needs: build-dist
steps:
- name: Trigger Snap workflow
run: |
gh workflow run snap.yml --ref ${{ github.sha }} --field source-tarball-id=${{ needs.build-dist.outputs.artifact-id }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-macos:
runs-on: namespace-profile-ghostty-macos-tahoe
needs: test
@ -355,44 +367,6 @@ jobs:
nix develop -c zig build --system ${{ steps.deps.outputs.deps }} -Demit-macos-app=false -Drenderer=metal -Dfont-backend=coretext_harfbuzz
nix develop -c zig build --system ${{ steps.deps.outputs.deps }} -Demit-macos-app=false -Drenderer=metal -Dfont-backend=coretext_noshape
build-snap:
strategy:
fail-fast: false
matrix:
os:
[namespace-profile-ghostty-snap, namespace-profile-ghostty-snap-arm64]
runs-on: ${{ matrix.os }}
timeout-minutes: 45
needs: [test, build-dist]
env:
ZIG_LOCAL_CACHE_DIR: /zig/local-cache
ZIG_GLOBAL_CACHE_DIR: /zig/global-cache
steps:
- name: Download Source Tarball Artifacts
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
with:
name: source-tarball
- name: Extract tarball
run: |
mkdir dist
tar --verbose --extract --strip-components 1 --directory dist --file ghostty-source.tar.gz
- name: Setup Cache
uses: namespacelabs/nscloud-cache-action@a289cf5d2fcd6874376aa92f0ef7f99dc923592a # v1.2.17
with:
path: |
/nix
/zig
- run: sudo apt install -y udev
- run: sudo systemctl start systemd-udevd
# Workaround until this is fixed: https://github.com/canonical/lxd-pkg-snap/pull/789
- run: |
_LXD_SNAP_DEVCGROUP_CONFIG="/var/lib/snapd/cgroup/snap.lxd.device"
sudo mkdir -p /var/lib/snapd/cgroup
echo 'self-managed=true' | sudo tee "${_LXD_SNAP_DEVCGROUP_CONFIG}"
- uses: snapcore/action-build@3bdaa03e1ba6bf59a65f84a751d943d549a54e79 # v1.3.0
with:
path: dist
build-windows:
runs-on: windows-2022
# this will not stop other jobs from running