feat(release): split desktop builds by platform

This commit is contained in:
Zeno Jiricek
2026-08-18 22:22:55 +09:30
parent 11809502ee
commit d9fd18474f
5 changed files with 197 additions and 46 deletions
+35
View File
@@ -0,0 +1,35 @@
name: Build Linux desktop
description: Build and store the Linux desktop package.
inputs:
version:
description: Package version.
required: true
artifact-name:
description: GitHub Actions artifact name.
required: true
runs:
using: composite
steps:
- name: Build Linux package
shell: bash
run: npm run desktop:dist -- --publish never --linux --x64
- name: Verify Linux artifacts
shell: bash
env:
VERSION: ${{ inputs.version }}
run: |
test -f "dist/desktop/SketchForge-$VERSION-x86_64.AppImage"
test -f dist/desktop/latest-linux.yml
- name: Store Linux artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.artifact-name }}
path: |
dist/desktop/SketchForge-*.AppImage
dist/desktop/latest-linux.yml
if-no-files-found: error
+77
View File
@@ -0,0 +1,77 @@
name: Build macOS desktop
description: Build and store the macOS desktop package.
inputs:
version:
description: Package version.
required: true
artifact-name:
description: GitHub Actions artifact name.
required: true
csc-link:
description: Developer ID Application certificate.
required: false
csc-key-password:
description: Developer ID Application certificate password.
required: false
apple-api-key:
description: App Store Connect API private key path.
required: false
apple-api-key-id:
description: App Store Connect API key ID.
required: false
apple-api-issuer:
description: App Store Connect API issuer ID.
required: false
runs:
using: composite
steps:
- name: Resolve macOS signing state
id: signing
shell: bash
env:
CSC_LINK: ${{ inputs.csc-link }}
CSC_KEY_PASSWORD: ${{ inputs.csc-key-password }}
APPLE_API_KEY: ${{ inputs.apple-api-key }}
APPLE_API_KEY_ID: ${{ inputs.apple-api-key-id }}
APPLE_API_ISSUER: ${{ inputs.apple-api-issuer }}
run: |
suffix=""
if [[ -z "$CSC_LINK" || -z "$CSC_KEY_PASSWORD" || -z "$APPLE_API_KEY" || -z "$APPLE_API_KEY_ID" || -z "$APPLE_API_ISSUER" ]]; then
suffix="-unsigned"
fi
echo "artifact_suffix=$suffix" >> "$GITHUB_OUTPUT"
- name: Build macOS package
shell: bash
env:
CSC_LINK: ${{ inputs.csc-link }}
CSC_KEY_PASSWORD: ${{ inputs.csc-key-password }}
APPLE_API_KEY: ${{ inputs.apple-api-key }}
APPLE_API_KEY_ID: ${{ inputs.apple-api-key-id }}
APPLE_API_ISSUER: ${{ inputs.apple-api-issuer }}
run: |
npm run desktop:dist -- --publish never --mac --universal \
"-c.mac.artifactName=\${productName}-\${version}-\${arch}${{ steps.signing.outputs.artifact_suffix }}.\${ext}"
- name: Verify macOS artifacts
shell: bash
env:
VERSION: ${{ inputs.version }}
run: |
suffix="${{ steps.signing.outputs.artifact_suffix }}"
test -f "dist/desktop/SketchForge-$VERSION-universal${suffix}.dmg"
test -f "dist/desktop/SketchForge-$VERSION-universal${suffix}.zip"
test -f dist/desktop/latest-mac.yml
- name: Store macOS artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.artifact-name }}
path: |
dist/desktop/SketchForge-*-universal*.dmg
dist/desktop/SketchForge-*-universal*.zip
dist/desktop/latest-mac.yml
if-no-files-found: error
+44
View File
@@ -0,0 +1,44 @@
name: Build Windows desktop
description: Build and store the Windows desktop package.
inputs:
version:
description: Package version.
required: true
artifact-name:
description: GitHub Actions artifact name.
required: true
runs:
using: composite
steps:
- name: Build Windows package
shell: bash
run: npm run desktop:dist -- --publish never --win --x64
- name: Verify Windows artifacts
shell: pwsh
env:
VERSION: ${{ inputs.version }}
run: |
$required = @(
"dist/desktop/SketchForge-Setup-$env:VERSION-x64.exe",
"dist/desktop/SketchForge-Setup-$env:VERSION-x64.exe.blockmap",
"dist/desktop/latest.yml"
)
foreach ($file in $required) {
if (-not (Test-Path $file -PathType Leaf)) {
throw "Missing Windows artifact: $file"
}
}
- name: Store Windows artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.artifact-name }}
path: |
dist/desktop/SketchForge-Setup-*-x64.exe
dist/desktop/SketchForge-Setup-*-x64.exe.blockmap
dist/desktop/latest.yml
if-no-files-found: error
+40 -46
View File
@@ -31,6 +31,9 @@ jobs:
- platform: linux - platform: linux
runner: ubuntu-latest runner: ubuntu-latest
artifact: desktop-linux artifact: desktop-linux
- platform: macos
runner: macos-latest
artifact: desktop-macos
runs-on: ${{ matrix.runner }} runs-on: ${{ matrix.runner }}
timeout-minutes: 45 timeout-minutes: 45
steps: steps:
@@ -86,55 +89,28 @@ jobs:
- name: Run tests - name: Run tests
run: npm test run: npm test
- name: Build desktop package - uses: ./.github/actions/build-mac
run: npm run desktop:dist -- --publish never if: matrix.platform == 'macos'
- name: Verify Windows artifacts
if: matrix.platform == 'windows'
shell: pwsh
env:
VERSION: ${{ steps.package.outputs.version }}
run: |
$required = @(
"dist/desktop/SketchForge-Setup-$env:VERSION-x64.exe",
"dist/desktop/SketchForge-Setup-$env:VERSION-x64.exe.blockmap",
"dist/desktop/latest.yml"
)
foreach ($file in $required) {
if (-not (Test-Path $file -PathType Leaf)) {
throw "Missing Windows artifact: $file"
}
}
- name: Verify Linux artifacts
if: matrix.platform == 'linux'
shell: bash
env:
VERSION: ${{ steps.package.outputs.version }}
run: |
test -f "dist/desktop/SketchForge-$VERSION-x86_64.AppImage"
test -f dist/desktop/latest-linux.yml
- name: Store Windows artifacts
if: matrix.platform == 'windows'
uses: actions/upload-artifact@v4
with: with:
name: ${{ matrix.artifact }} version: ${{ steps.package.outputs.version }}
path: | artifact-name: ${{ matrix.artifact }}
dist/desktop/SketchForge-Setup-*-x64.exe csc-link: ${{ secrets.CSC_LINK }}
dist/desktop/SketchForge-Setup-*-x64.exe.blockmap csc-key-password: ${{ secrets.CSC_KEY_PASSWORD }}
dist/desktop/latest.yml apple-api-key: ${{ secrets.APPLE_API_KEY }}
if-no-files-found: error apple-api-key-id: ${{ secrets.APPLE_API_KEY_ID }}
apple-api-issuer: ${{ secrets.APPLE_API_ISSUER }}
- name: Store Linux artifacts - uses: ./.github/actions/build-linux
if: matrix.platform == 'linux' if: matrix.platform == 'linux'
uses: actions/upload-artifact@v4
with: with:
name: ${{ matrix.artifact }} version: ${{ steps.package.outputs.version }}
path: | artifact-name: ${{ matrix.artifact }}
dist/desktop/SketchForge-*.AppImage
dist/desktop/latest-linux.yml - uses: ./.github/actions/build-win32
if-no-files-found: error if: matrix.platform == 'windows'
with:
version: ${{ steps.package.outputs.version }}
artifact-name: ${{ matrix.artifact }}
attach: attach:
name: Attach packages to release name: Attach packages to release
@@ -207,6 +183,12 @@ jobs:
name: desktop-linux name: desktop-linux
path: dist/release path: dist/release
- name: Download macOS artifacts
uses: actions/download-artifact@v4
with:
name: desktop-macos
path: dist/release
- name: Create draft release - name: Create draft release
env: env:
GH_TOKEN: ${{ github.token }} GH_TOKEN: ${{ github.token }}
@@ -238,16 +220,28 @@ jobs:
GH_TOKEN: ${{ github.token }} GH_TOKEN: ${{ github.token }}
TAG: ${{ steps.version.outputs.tag }} TAG: ${{ steps.version.outputs.tag }}
VERSION: ${{ steps.package.outputs.version }} VERSION: ${{ steps.package.outputs.version }}
CSC_LINK: ${{ secrets.CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }}
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }}
APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
run: | run: |
assets=$(gh release view "$TAG" --json isDraft,assets) assets=$(gh release view "$TAG" --json isDraft,assets)
test "$(jq -r '.isDraft' <<< "$assets")" = "true" test "$(jq -r '.isDraft' <<< "$assets")" = "true"
names=$(jq -r '.assets[].name' <<< "$assets") names=$(jq -r '.assets[].name' <<< "$assets")
suffix=""
if [[ -z "$CSC_LINK" || -z "$CSC_KEY_PASSWORD" || -z "$APPLE_API_KEY" || -z "$APPLE_API_KEY_ID" || -z "$APPLE_API_ISSUER" ]]; then
suffix="-unsigned"
fi
for expected in \ for expected in \
"SketchForge-Setup-$VERSION-x64.exe" \ "SketchForge-Setup-$VERSION-x64.exe" \
"SketchForge-Setup-$VERSION-x64.exe.blockmap" \ "SketchForge-Setup-$VERSION-x64.exe.blockmap" \
"latest.yml" \ "latest.yml" \
"SketchForge-$VERSION-x86_64.AppImage" \ "SketchForge-$VERSION-x86_64.AppImage" \
"latest-linux.yml"; do "latest-linux.yml" \
"SketchForge-$VERSION-universal${suffix}.dmg" \
"SketchForge-$VERSION-universal${suffix}.zip" \
"latest-mac.yml"; do
grep -Fxq "$expected" <<< "$names" || { grep -Fxq "$expected" <<< "$names" || {
echo "GitHub release is missing $expected" >&2 echo "GitHub release is missing $expected" >&2
exit 1 exit 1
+1
View File
@@ -42,6 +42,7 @@ mac:
icon: apps/web/public/assets/sketchforge/sketchforge-logo.png icon: apps/web/public/assets/sketchforge/sketchforge-logo.png
target: target:
- dmg - dmg
- zip
category: public.app-category.graphics-design category: public.app-category.graphics-design
artifactName: ${productName}-${version}-${arch}.${ext} artifactName: ${productName}-${version}-${arch}.${ext}