Skip to content

Commit cdd58a9

Browse files
authored
Merge pull request #220 from gui-cs/tig/issue-219-ted-aot-release-artifacts
feat: include AOT binaries of ted in release artifacts
2 parents fab4dae + 88a9092 commit cdd58a9

2 files changed

Lines changed: 96 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 88 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,13 @@ jobs:
6565
strategy:
6666
fail-fast: false
6767
matrix:
68-
os: [ubuntu-latest, macos-latest, windows-latest]
68+
include:
69+
- os: ubuntu-latest
70+
rid: linux-x64
71+
- os: macos-latest
72+
rid: osx-arm64
73+
- os: windows-latest
74+
rid: win-x64
6975
runs-on: ${{ matrix.os }}
7076
env:
7177
VERSION: ${{ needs.resolve-version.outputs.version }}
@@ -93,6 +99,22 @@ jobs:
9399
- name: Terminal.Gui.Editor.IntegrationTests
94100
run: dotnet run --project tests/Terminal.Gui.Editor.IntegrationTests --no-build -c Release
95101

102+
- name: Publish ted AOT
103+
run: >
104+
dotnet publish examples/ted -c Release
105+
-r ${{ matrix.rid }}
106+
--self-contained
107+
-p:PublishAot=true
108+
-p:Version=${{ env.VERSION }}
109+
-o publish/${{ matrix.rid }}
110+
111+
- name: Upload ted artifact
112+
uses: actions/upload-artifact@v4
113+
with:
114+
name: ted-${{ matrix.rid }}
115+
path: publish/${{ matrix.rid }}/
116+
retention-days: 30
117+
96118
pack-and-publish:
97119
needs: [resolve-version, build-and-test]
98120
runs-on: ubuntu-latest
@@ -124,6 +146,71 @@ jobs:
124146
--source https://api.nuget.org/v3/index.json
125147
--skip-duplicate
126148
149+
# Attach ted AOT binaries to the GitHub Release (tag pushes only).
150+
# The Release is created by finalize-release.yml before the tag push triggers this workflow.
151+
release-assets:
152+
if: github.ref_type == 'tag'
153+
needs: [resolve-version, build-and-test]
154+
runs-on: ubuntu-latest
155+
env:
156+
VERSION: ${{ needs.resolve-version.outputs.version }}
157+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
158+
GH_REPO: ${{ github.repository }}
159+
steps:
160+
- uses: actions/checkout@v5
161+
162+
- name: Download all ted artifacts
163+
uses: actions/download-artifact@v4
164+
with:
165+
pattern: ted-*
166+
path: artifacts/
167+
168+
- name: Package release archives
169+
shell: bash
170+
run: |
171+
set -euo pipefail
172+
mkdir -p dist
173+
174+
package_unix() {
175+
local rid="$1"
176+
local src="artifacts/ted-${rid}"
177+
if [ ! -d "$src" ]; then
178+
echo "::warning::No artifact for ${rid}, skipping"
179+
return 0
180+
fi
181+
chmod +x "$src/ted" 2>/dev/null || true
182+
tar -czf "dist/ted-${VERSION}-${rid}.tar.gz" -C "$src" .
183+
echo "Created dist/ted-${VERSION}-${rid}.tar.gz"
184+
}
185+
186+
package_windows() {
187+
local rid="$1"
188+
local src="artifacts/ted-${rid}"
189+
if [ ! -d "$src" ]; then
190+
echo "::warning::No artifact for ${rid}, skipping"
191+
return 0
192+
fi
193+
(cd "$src" && zip -r "../../dist/ted-${VERSION}-${rid}.zip" .)
194+
echo "Created dist/ted-${VERSION}-${rid}.zip"
195+
}
196+
197+
package_unix osx-arm64
198+
package_unix linux-x64
199+
package_windows win-x64
200+
201+
ls -la dist/
202+
203+
- name: Upload to GitHub Release
204+
shell: bash
205+
run: |
206+
TAG="${GITHUB_REF_NAME}"
207+
if gh release view "$TAG" >/dev/null 2>&1; then
208+
gh release upload "$TAG" dist/* --clobber
209+
else
210+
echo "::warning::Release $TAG not found; creating one."
211+
gh release create "$TAG" --title "ted $TAG" --generate-notes dist/*
212+
fi
213+
127214
# Notify downstream repos (gui-cs/clet) so they can rebuild against the new Editor version.
128215
# Uses a PAT stored as CLET_DISPATCH_TOKEN with `repo` scope on gui-cs/clet.
129216
notify-downstream:

examples/ted/ted.csproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@
55
<RootNamespace>Ted</RootNamespace>
66
<AssemblyName>ted</AssemblyName>
77
<IsPackable>false</IsPackable>
8+
9+
<!-- NativeAOT publish settings (apply only to `dotnet publish`, not `dotnet build`). -->
10+
<PublishAot>true</PublishAot>
11+
<InvariantGlobalization>false</InvariantGlobalization>
12+
<StackTraceSupport>true</StackTraceSupport>
13+
<DebuggerSupport>false</DebuggerSupport>
14+
<EventSourceSupport>false</EventSourceSupport>
15+
<UseSystemResourceKeys>true</UseSystemResourceKeys>
816
</PropertyGroup>
917

1018
<ItemGroup>

0 commit comments

Comments
 (0)