Repository navigation
70 lines (70 loc) · 2.97 KB
/
Copy pathbuild.yml
File metadata and controls
70 lines (70 loc) · 2.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Build candidates with a fixed public host SDK; publishing and marketplace review remain explicit.
name: Independent plugin package
on:
push:
branches: [main]
# Stable tags reuse this source commit; they do not repeat its branch build.
pull_request:
workflow_dispatch:
permissions:
contents: read
env:
RUSTUP_TOOLCHAIN: '1.98.1'
RUST_MIN_STACK: '16777216'
CARGO_TERM_COLOR: never
jobs:
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v6
with:
path: plugin
persist-credentials: false
- name: Read the committed SDK pin
id: sdk
shell: pwsh
run: |
# PR input can select a public revision, but receives no release or write credentials.
$pin = Get-Content plugin/host-sdk.json -Raw | ConvertFrom-Json
if ($pin.schema -ne 1 -or $pin.repository -ne 'Nanobug-Editor/Editor' -or $pin.revision -notmatch '^[0-9a-f]{40}$') {
throw 'Invalid public host SDK pin'
}
"revision=$($pin.revision)" >> $env:GITHUB_OUTPUT
- name: Prepare the declared CI toolchain
shell: pwsh
run: |
# Only the disposable CI runner installs this declared toolchain; local builds report missing tools.
rustup toolchain install 1.98.1 --profile minimal --target wasm32-wasip2
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
- uses: actions/checkout@v6
with:
repository: Nanobug-Editor/Editor
ref: ${{ steps.sdk.outputs.revision }}
path: host
persist-credentials: false
- name: Build the public host entry
working-directory: host
run: cargo build --locked -p editor-app
- name: Test and package this independent project
shell: pwsh
run: |
$pluginHost = Join-Path $env:GITHUB_WORKSPACE 'host/target/debug/editor-app.exe'
$project = Join-Path $env:GITHUB_WORKSPACE 'plugin'
$output = Join-Path $env:GITHUB_WORKSPACE 'artifact'
$description = Get-Content plugin/nanobug-plugin.json -Raw | ConvertFrom-Json
if ($description.wasm) {
& $pluginHost --plugin-cargo (Join-Path $project $description.wasm.manifest) test --lib --locked
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
}
& $pluginHost --plugin-package $project --output $output
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
# Record the complete ZIP bytes; a later rebuild does not replace a published attachment.
Get-ChildItem -LiteralPath $output -Filter '*.zip' | ForEach-Object {
$digest = (Get-FileHash -LiteralPath $_.FullName -Algorithm SHA256).Hash.ToLowerInvariant()
"$digest $($_.Name)" | Set-Content -LiteralPath ($_.FullName + '.sha256') -Encoding utf8
}
- uses: actions/upload-artifact@v4
with:
name: plugin-${{ github.sha }}-windows-x86_64
path: artifact
if-no-files-found: error