Skip to content

Commit d481ea1

Browse files
committed
add portable binary release validation
1 parent e2126a1 commit d481ea1

8 files changed

Lines changed: 514 additions & 13 deletions

File tree

.github/workflows/build-matrix.yaml

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,155 @@ jobs:
7676
with:
7777
name: skillet-checksums
7878
path: dist/SHA256SUMS
79+
80+
qemu-smoke:
81+
needs: build
82+
runs-on: ubuntu-latest
83+
84+
steps:
85+
- name: Checkout
86+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
87+
88+
- name: Setup QEMU
89+
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e8
90+
91+
- name: Download build artifacts
92+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
93+
with:
94+
path: dist
95+
merge-multiple: true
96+
97+
- name: Make Linux artifacts executable
98+
shell: bash
99+
run: |
100+
set -euo pipefail
101+
chmod +x dist/skillet-linux-*
102+
103+
- name: Smoke test arm64 musl artifact under emulation
104+
shell: bash
105+
run: |
106+
set -euo pipefail
107+
OUTPUT=$(docker run --rm --platform linux/arm64/v8 -v "$PWD/dist:/artifacts:ro" alpine:3.22 /artifacts/skillet-linux-arm64-musl --version)
108+
printf '%s\n' "$OUTPUT"
109+
grep -F "sklt/" <<< "$OUTPUT"
110+
111+
- name: Smoke test arm64 gnu artifact under emulation
112+
shell: bash
113+
run: |
114+
set -euo pipefail
115+
OUTPUT=$(docker run --rm --platform linux/arm64/v8 -v "$PWD/dist:/artifacts:ro" ubuntu:24.04 /artifacts/skillet-linux-arm64-gnu --version)
116+
printf '%s\n' "$OUTPUT"
117+
grep -F "sklt/" <<< "$OUTPUT"
118+
119+
wine-smoke:
120+
needs: build
121+
runs-on: ubuntu-latest
122+
123+
env:
124+
WINEDEBUG: -all
125+
126+
steps:
127+
- name: Checkout
128+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
129+
130+
- name: Setup mise
131+
uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac
132+
133+
- name: Install Wine
134+
shell: bash
135+
run: |
136+
set -euo pipefail
137+
sudo apt-get update
138+
sudo apt-get install -y wine64
139+
140+
- name: Download build artifacts
141+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
142+
with:
143+
path: dist
144+
merge-multiple: true
145+
146+
- name: Smoke test Windows artifact with Wine
147+
run: bun scripts/smoke-artifact.ts --target=windows-x64 --artifact-dir=dist --runner=wine64
148+
149+
docker-integration:
150+
runs-on: ubuntu-latest
151+
152+
steps:
153+
- name: Checkout
154+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
155+
156+
- name: Setup mise
157+
uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac
158+
159+
- name: Setup QEMU
160+
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e8
161+
162+
- name: Build musl binaries
163+
run: mise run build -- --targets=linux-x64-musl,linux-arm64-musl
164+
165+
- name: Smoke test amd64 Docker image
166+
shell: bash
167+
run: |
168+
set -euo pipefail
169+
docker buildx create --name skillet-smoke-builder --use || docker buildx use skillet-smoke-builder
170+
docker buildx build --platform linux/amd64 --load -t skillet:amd64 .
171+
docker run --rm --platform linux/amd64 skillet:amd64 --help
172+
173+
- name: Smoke test arm64 Docker image
174+
shell: bash
175+
run: |
176+
set -euo pipefail
177+
docker buildx use skillet-smoke-builder
178+
docker buildx build --platform linux/arm64 --load -t skillet:arm64 .
179+
docker run --rm --platform linux/arm64 skillet:arm64 --help
180+
181+
packaging-validate:
182+
needs: checksums
183+
runs-on: ubuntu-latest
184+
185+
steps:
186+
- name: Checkout
187+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
188+
189+
- name: Setup mise
190+
uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac
191+
192+
- name: Download checksum artifact
193+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
194+
with:
195+
name: skillet-checksums
196+
path: dist
197+
198+
- name: Validate rendered packaging assets
199+
run: mise run package-validate
200+
201+
- name: Validate Homebrew formula syntax
202+
run: ruby -c packaging/homebrew/skillet.rb
203+
204+
windows-packaging-validate:
205+
runs-on: windows-latest
206+
207+
steps:
208+
- name: Checkout
209+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
210+
211+
- name: Pack Chocolatey package
212+
shell: pwsh
213+
run: |
214+
New-Item -ItemType Directory -Force -Path dist/choco | Out-Null
215+
choco pack packaging/chocolatey/skillet.nuspec --outputdirectory dist/choco
216+
217+
- name: Validate Chocolatey PowerShell scripts
218+
shell: pwsh
219+
run: |
220+
[scriptblock]::Create((Get-Content -Raw packaging/chocolatey/tools/chocolateyinstall.ps1)) | Out-Null
221+
[scriptblock]::Create((Get-Content -Raw packaging/chocolatey/tools/chocolateyuninstall.ps1)) | Out-Null
222+
223+
- name: Validate winget manifests parse as YAML
224+
shell: pwsh
225+
run: |
226+
$package = Get-Content package.json -Raw | ConvertFrom-Json
227+
$wingetDir = Join-Path packaging/winget $package.version
228+
Get-Content (Join-Path $wingetDir 'echohello-dev.skillet.yaml') -Raw | ConvertFrom-Yaml | Out-Null
229+
Get-Content (Join-Path $wingetDir 'echohello-dev.skillet.installer.yaml') -Raw | ConvertFrom-Yaml | Out-Null
230+
Get-Content (Join-Path $wingetDir 'echohello-dev.skillet.locale.en-US.yaml') -Raw | ConvertFrom-Yaml | Out-Null
Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
name: Release Binaries
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
workflow_dispatch:
8+
inputs:
9+
ref:
10+
description: Git ref to release, usually a tag like v1.0.0
11+
required: true
12+
type: string
13+
14+
permissions:
15+
contents: write
16+
17+
concurrency:
18+
group: release-binaries-${{ github.event_name == 'release' && github.event.release.tag_name || inputs.ref }}
19+
cancel-in-progress: false
20+
21+
jobs:
22+
build:
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
include:
27+
- os: ubuntu-latest
28+
targets: linux-x64-gnu,linux-x64-musl,linux-arm64-gnu,linux-arm64-musl
29+
- os: macos-latest
30+
targets: darwin-arm64,darwin-x64
31+
- os: windows-latest
32+
targets: windows-x64
33+
34+
runs-on: ${{ matrix.os }}
35+
36+
steps:
37+
- name: Checkout
38+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
39+
with:
40+
ref: ${{ github.event_name == 'release' && github.event.release.tag_name || inputs.ref }}
41+
42+
- name: Setup mise
43+
uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac
44+
45+
- name: Build targets
46+
run: mise run build -- --targets=${{ matrix.targets }}
47+
48+
- name: Smoke test host artifact
49+
run: bun scripts/smoke-artifact.ts
50+
51+
- name: Upload build artifacts
52+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
53+
with:
54+
name: release-${{ matrix.os }}
55+
path: dist/*
56+
57+
upload:
58+
needs: build
59+
runs-on: ubuntu-latest
60+
61+
steps:
62+
- name: Checkout
63+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
64+
with:
65+
ref: ${{ github.event_name == 'release' && github.event.release.tag_name || inputs.ref }}
66+
67+
- name: Setup mise
68+
uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac
69+
70+
- name: Download build artifacts
71+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
72+
with:
73+
path: .artifacts
74+
merge-multiple: true
75+
76+
- name: Assemble release assets
77+
shell: bash
78+
run: |
79+
set -euo pipefail
80+
mkdir -p dist
81+
cp .artifacts/skillet-* dist/ || true
82+
cp .artifacts/*.exe dist/ || true
83+
bun scripts/write-checksums.ts
84+
85+
- name: Upload release assets
86+
env:
87+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
88+
RELEASE_TAG: ${{ github.event_name == 'release' && github.event.release.tag_name || inputs.ref }}
89+
shell: bash
90+
run: |
91+
set -euo pipefail
92+
gh release upload "$RELEASE_TAG" dist/skillet-* dist/*.exe dist/SHA256SUMS --clobber
93+
94+
verify-homebrew:
95+
needs: upload
96+
runs-on: macos-latest
97+
env:
98+
HOMEBREW_NO_AUTO_UPDATE: 1
99+
100+
steps:
101+
- name: Checkout
102+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
103+
with:
104+
ref: ${{ github.event_name == 'release' && github.event.release.tag_name || inputs.ref }}
105+
106+
- name: Install from Homebrew formula
107+
run: brew install --formula ./packaging/homebrew/skillet.rb
108+
109+
- name: Verify Homebrew install
110+
run: skillet --version
111+
112+
- name: Uninstall Homebrew formula
113+
if: always()
114+
run: brew uninstall skillet
115+
116+
verify-chocolatey:
117+
needs: upload
118+
runs-on: windows-latest
119+
120+
steps:
121+
- name: Checkout
122+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
123+
with:
124+
ref: ${{ github.event_name == 'release' && github.event.release.tag_name || inputs.ref }}
125+
126+
- name: Pack Chocolatey package
127+
shell: pwsh
128+
run: |
129+
New-Item -ItemType Directory -Force -Path dist/choco | Out-Null
130+
choco pack packaging/chocolatey/skillet.nuspec --outputdirectory dist/choco
131+
132+
- name: Install from Chocolatey package
133+
shell: pwsh
134+
run: |
135+
choco install skillet --source "$PWD\dist\choco" --yes --no-progress
136+
137+
- name: Verify Chocolatey install
138+
shell: pwsh
139+
run: skillet --version
140+
141+
- name: Uninstall Chocolatey package
142+
if: always()
143+
shell: pwsh
144+
run: |
145+
choco uninstall skillet --yes --no-progress
146+
147+
verify-winget:
148+
needs: upload
149+
runs-on: windows-latest
150+
151+
steps:
152+
- name: Checkout
153+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
154+
with:
155+
ref: ${{ github.event_name == 'release' && github.event.release.tag_name || inputs.ref }}
156+
157+
- name: Validate winget manifests
158+
shell: pwsh
159+
run: |
160+
$package = Get-Content package.json -Raw | ConvertFrom-Json
161+
$manifest = Join-Path (Join-Path packaging/winget $package.version) 'echohello-dev.skillet.yaml'
162+
winget validate $manifest
163+
164+
- name: Install from winget manifest
165+
shell: pwsh
166+
run: |
167+
$package = Get-Content package.json -Raw | ConvertFrom-Json
168+
$manifest = Join-Path (Join-Path packaging/winget $package.version) 'echohello-dev.skillet.yaml'
169+
winget install --manifest $manifest --accept-source-agreements --accept-package-agreements --disable-interactivity
170+
171+
- name: Verify winget install
172+
shell: pwsh
173+
run: skillet --version
174+
175+
- name: Uninstall winget package
176+
if: always()
177+
shell: pwsh
178+
run: |
179+
winget uninstall --id echohello-dev.skillet --exact --disable-interactivity || exit 0

.mise.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ run = "mise run build -- --targets=linux-x64-musl,linux-arm64-musl && docker bui
3131
[tasks.build-npm]
3232
run = "mise run install && bun scripts/build-npm-cli.ts"
3333

34+
[tasks.package-validate]
35+
run = "mise run install && bun scripts/validate-packaging.ts"
36+
3437
[tasks.npm-smoke]
3538
run = "mise run build-npm && npm pack >/tmp/skillet-npm-pack.log && PACKAGE=$(tail -n 1 /tmp/skillet-npm-pack.log) && npx --yes --package \"./$PACKAGE\" sklt --help && REPO_DIR=\"$PWD\" && TMP_DIR=$(mktemp -d) && (cd \"$TMP_DIR\" && bun init -y >/dev/null 2>&1 && bun add \"$REPO_DIR/$PACKAGE\" >/dev/null && bunx --bun sklt --help) && rm -rf \"$TMP_DIR\" \"$PACKAGE\""
3639

packaging/winget/0.0.0/echohello-dev.skillet.installer.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@ PackageIdentifier: echohello-dev.skillet
22
PackageVersion: 0.0.0
33
Installers:
44
- Architecture: x64
5-
InstallerType: exe
5+
InstallerType: portable
66
InstallerUrl: https://github.com/echohello-dev/skillet/releases/download/v0.0.0/skillet-windows-x64.exe
77
InstallerSha256: 51CDDEFDE243F0F27E501CA420D5E1D1B9CAD548DC9884EA4052D2915AFEF179
8-
AppsAndFeaturesEntries:
9-
- DisplayName: skillet
108
Commands:
119
- skillet
1210
ManifestType: installer

0 commit comments

Comments
 (0)