1212 required : true
1313 type : boolean
1414 default : true
15+ profile :
16+ description : " Native binary build profile. Auto keeps releases optimized and previews in debug mode."
17+ required : true
18+ type : choice
19+ options :
20+ - auto
21+ - release
22+ - debug
23+ default : auto
1524
1625concurrency :
1726 group : publish-${{ github.ref }}
3544 npm_tag : ${{ steps.ctx.outputs.npm_tag }}
3645 sha : ${{ steps.ctx.outputs.sha }}
3746 latest : ${{ steps.ctx.outputs.latest }}
47+ build_profile : ${{ steps.mode.outputs.profile }}
3848 steps :
3949 - uses : actions/checkout@v4
4050 with :
4959 - id : ctx
5060 name : Resolve publish context
5161 run : pnpm --filter=publish exec tsx src/ci/bin.ts context-output
62+ - id : mode
63+ name : Resolve native build profile
64+ env :
65+ REQUESTED_PROFILE : ${{ inputs.profile }}
66+ TRIGGER : ${{ steps.ctx.outputs.trigger }}
67+ run : |
68+ set -euo pipefail
69+ profile="${REQUESTED_PROFILE:-auto}"
70+ if [ "$profile" = "auto" ]; then
71+ if [ "$TRIGGER" = "release" ]; then
72+ profile="release"
73+ else
74+ profile="debug"
75+ fi
76+ fi
77+ case "$profile" in
78+ release|debug) ;;
79+ *) echo "invalid native build profile: $profile" >&2; exit 2 ;;
80+ esac
81+ echo "profile=$profile" >> "$GITHUB_OUTPUT"
5282
5383 wasm-commands :
5484 name : WASM Commands
@@ -121,23 +151,14 @@ jobs:
121151 with :
122152 name : agentos-${{ matrix.platform }}
123153 keep-state : ${{ contains(matrix.runner, 'self-hosted') }}
124- - name : Resolve build profile
125- id : mode
126- run : |
127- set -euo pipefail
128- if [ "${{ needs.context.outputs.trigger }}" = "release" ]; then
129- echo "profile=release" >> "$GITHUB_OUTPUT"
130- else
131- echo "profile=debug" >> "$GITHUB_OUTPUT"
132- fi
133154 - name : Build linux artifacts
134155 uses : docker/build-push-action@v6
135156 with :
136157 context : .
137158 file : docker/build/linux-gnu.Dockerfile
138159 build-args : |
139160 TARGET=${{ matrix.target }}
140- BUILD_PROFILE=${{ steps.mode .outputs.profile }}
161+ BUILD_PROFILE=${{ needs.context .outputs.build_profile }}
141162 CACHE_PLATFORM=${{ matrix.platform }}
142163 RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
143164 LINUX_GNU_LLVM_VERSION=${{ env.LINUX_GNU_LLVM_VERSION }}
@@ -197,15 +218,6 @@ jobs:
197218 keep-state : true
198219 - name : Log in to ghcr.io
199220 run : echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
200- - name : Compute build profile
201- id : mode
202- run : |
203- set -euo pipefail
204- if [ "${{ needs.context.outputs.trigger }}" = "release" ]; then
205- echo "profile=release" >> "$GITHUB_OUTPUT"
206- else
207- echo "profile=debug" >> "$GITHUB_OUTPUT"
208- fi
209221 - name : Cross-compile via osxcross
210222 uses : docker/build-push-action@v6
211223 with :
@@ -214,7 +226,7 @@ jobs:
214226 build-args : |
215227 TARGET=${{ matrix.target }}
216228 CLANG=${{ matrix.clang }}
217- BUILD_PROFILE=${{ steps.mode .outputs.profile }}
229+ BUILD_PROFILE=${{ needs.context .outputs.build_profile }}
218230 CACHE_PLATFORM=${{ matrix.platform }}
219231 RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
220232 tags : agentos-darwin-${{ matrix.platform }}
0 commit comments