|
65 | 65 | strategy: |
66 | 66 | fail-fast: false |
67 | 67 | 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 |
69 | 75 | runs-on: ${{ matrix.os }} |
70 | 76 | env: |
71 | 77 | VERSION: ${{ needs.resolve-version.outputs.version }} |
|
93 | 99 | - name: Terminal.Gui.Editor.IntegrationTests |
94 | 100 | run: dotnet run --project tests/Terminal.Gui.Editor.IntegrationTests --no-build -c Release |
95 | 101 |
|
| 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 | + |
96 | 118 | pack-and-publish: |
97 | 119 | needs: [resolve-version, build-and-test] |
98 | 120 | runs-on: ubuntu-latest |
@@ -124,6 +146,71 @@ jobs: |
124 | 146 | --source https://api.nuget.org/v3/index.json |
125 | 147 | --skip-duplicate |
126 | 148 |
|
| 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 | +
|
127 | 214 | # Notify downstream repos (gui-cs/clet) so they can rebuild against the new Editor version. |
128 | 215 | # Uses a PAT stored as CLET_DISPATCH_TOKEN with `repo` scope on gui-cs/clet. |
129 | 216 | notify-downstream: |
|
0 commit comments