Skip to content

Commit f122725

Browse files
committed
fix release and PR pipelines
1 parent 39d9ca6 commit f122725

File tree

8 files changed

+400
-33
lines changed

8 files changed

+400
-33
lines changed
Lines changed: 134 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,99 @@
1-
name: Deploy GitHub Pages
1+
name: Release Pipeline
22

33
on:
44
push:
55
branches:
66
- main
7-
release:
8-
types:
9-
- published
107
workflow_dispatch:
118

129
permissions:
13-
contents: read
10+
contents: write
1411
pages: write
1512
id-token: write
1613

1714
concurrency:
18-
group: github-pages
15+
group: release-pipeline
1916
cancel-in-progress: true
2017

2118
env:
2219
APP_PROJECT: src/PrompterLive.App/PrompterLive.App.csproj
2320
PAGES_ARTIFACT_ROOT: .artifacts/prompterlive-pages
24-
PAGES_BASE_PATH: /${{ github.event.repository.name }}/
21+
PAGES_BASE_PATH: /
22+
PAGES_CNAME: prompter.managed-code.com
2523
PUBLISH_ROOT: .artifacts/prompterlive-publish
24+
RELEASE_ARCHIVE_NAME: prompterlive-pages.zip
25+
RELEASE_ARTIFACT_NAME: prompterlive-release-package
26+
RELEASE_ARTIFACT_ROOT: .artifacts/release-artifact
27+
SOLUTION_FILE: PrompterLive.slnx
2628

2729
jobs:
28-
deploy:
30+
validate_release:
31+
name: Build And Test
2932
runs-on: ubuntu-latest
30-
environment:
31-
name: github-pages
32-
url: ${{ steps.deployment.outputs.page_url }}
33+
34+
permissions:
35+
contents: read
3336

3437
steps:
3538
- name: Checkout
36-
uses: actions/checkout@v4
39+
uses: actions/checkout@v6
3740

3841
- name: Setup .NET
39-
uses: actions/setup-dotnet@v4
42+
uses: actions/setup-dotnet@v5
4043
with:
4144
global-json-file: global.json
4245

43-
- name: Configure GitHub Pages
44-
uses: actions/configure-pages@v5
46+
- name: Build solution
47+
run: dotnet build "$SOLUTION_FILE" -warnaserror
48+
49+
- name: Test solution
50+
run: dotnet test "$SOLUTION_FILE" --no-build
51+
52+
prepare_release:
53+
name: Resolve Release Version
54+
needs: validate_release
55+
runs-on: ubuntu-latest
56+
57+
permissions:
58+
contents: read
59+
60+
outputs:
61+
release_tag: ${{ steps.release_version.outputs.release_tag }}
62+
release_version: ${{ steps.release_version.outputs.release_version }}
63+
64+
steps:
65+
- name: Checkout
66+
uses: actions/checkout@v6
67+
68+
- name: Setup .NET
69+
uses: actions/setup-dotnet@v5
70+
with:
71+
global-json-file: global.json
72+
73+
- name: Resolve release version
74+
id: release_version
75+
run: |
76+
release_version="$(dotnet msbuild "$APP_PROJECT" -getProperty:VersionPrefix -p:PrompterLiveBuildNumber=${{ github.run_number }} | tr -d '\r')"
77+
release_tag="v${release_version}"
78+
echo "release_version=$release_version" >> "$GITHUB_OUTPUT"
79+
echo "release_tag=$release_tag" >> "$GITHUB_OUTPUT"
80+
81+
publish_release_build:
82+
name: Publish Release Build
83+
needs: prepare_release
84+
runs-on: ubuntu-latest
85+
86+
permissions:
87+
contents: read
88+
89+
steps:
90+
- name: Checkout
91+
uses: actions/checkout@v6
92+
93+
- name: Setup .NET
94+
uses: actions/setup-dotnet@v5
95+
with:
96+
global-json-file: global.json
4597

4698
- name: Publish standalone WASM app
4799
run: >
@@ -57,13 +109,78 @@ jobs:
57109
cp -R "$PUBLISH_ROOT/wwwroot/." "$PAGES_ARTIFACT_ROOT/"
58110
sed -i "s#<base href=\"/\" />#<base href=\"${PAGES_BASE_PATH}\" />#g" "$PAGES_ARTIFACT_ROOT/index.html"
59111
cp "$PAGES_ARTIFACT_ROOT/index.html" "$PAGES_ARTIFACT_ROOT/404.html"
112+
printf '%s\n' "$PAGES_CNAME" > "$PAGES_ARTIFACT_ROOT/CNAME"
60113
touch "$PAGES_ARTIFACT_ROOT/.nojekyll"
61114
115+
- name: Archive release bundle
116+
run: |
117+
mkdir -p "$RELEASE_ARTIFACT_ROOT"
118+
cd "$PAGES_ARTIFACT_ROOT"
119+
zip -r "$GITHUB_WORKSPACE/$RELEASE_ARTIFACT_ROOT/$RELEASE_ARCHIVE_NAME" .
120+
121+
- name: Upload GitHub release artifact
122+
uses: actions/upload-artifact@v7
123+
with:
124+
name: ${{ env.RELEASE_ARTIFACT_NAME }}
125+
path: ${{ env.RELEASE_ARTIFACT_ROOT }}/${{ env.RELEASE_ARCHIVE_NAME }}
126+
62127
- name: Upload Pages artifact
63-
uses: actions/upload-pages-artifact@v3
128+
uses: actions/upload-pages-artifact@v4
64129
with:
65130
path: ${{ env.PAGES_ARTIFACT_ROOT }}
66131

132+
publish_github_release:
133+
name: Publish GitHub Release
134+
needs:
135+
- prepare_release
136+
- publish_release_build
137+
runs-on: ubuntu-latest
138+
139+
permissions:
140+
contents: write
141+
142+
steps:
143+
- name: Download release artifact
144+
uses: actions/download-artifact@v8
145+
with:
146+
name: ${{ env.RELEASE_ARTIFACT_NAME }}
147+
path: ${{ env.RELEASE_ARTIFACT_ROOT }}
148+
149+
- name: Create or update release tag and GitHub Release
150+
env:
151+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
152+
RELEASE_TAG: ${{ needs.prepare_release.outputs.release_tag }}
153+
RELEASE_TITLE: PrompterLive ${{ needs.prepare_release.outputs.release_version }}
154+
run: |
155+
release_asset="$RELEASE_ARTIFACT_ROOT/$RELEASE_ARCHIVE_NAME"
156+
if gh release view "$RELEASE_TAG" >/dev/null 2>&1; then
157+
gh release upload "$RELEASE_TAG" "$release_asset" --clobber
158+
gh release edit "$RELEASE_TAG" --title "$RELEASE_TITLE"
159+
else
160+
gh release create "$RELEASE_TAG" "$release_asset" \
161+
--title "$RELEASE_TITLE" \
162+
--generate-notes \
163+
--target "$GITHUB_SHA"
164+
fi
165+
166+
deploy_github_pages:
167+
name: Deploy GitHub Pages
168+
needs:
169+
- publish_release_build
170+
- publish_github_release
171+
runs-on: ubuntu-latest
172+
environment:
173+
name: github-pages
174+
url: ${{ steps.deployment.outputs.page_url }}
175+
176+
permissions:
177+
pages: write
178+
id-token: write
179+
180+
steps:
181+
- name: Configure GitHub Pages
182+
uses: actions/configure-pages@v6
183+
67184
- name: Deploy to GitHub Pages
68185
id: deployment
69-
uses: actions/deploy-pages@v4
186+
uses: actions/deploy-pages@v5
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: PR Validation
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
12+
concurrency:
13+
group: pr-validation-${{ github.event.pull_request.number || github.ref }}
14+
cancel-in-progress: true
15+
16+
env:
17+
SOLUTION_FILE: PrompterLive.slnx
18+
19+
jobs:
20+
build_and_test:
21+
name: Build And Test
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v6
27+
28+
- name: Setup .NET
29+
uses: actions/setup-dotnet@v5
30+
with:
31+
global-json-file: global.json
32+
33+
- name: Build solution
34+
run: dotnet build "$SOLUTION_FILE" -warnaserror
35+
36+
- name: Test solution
37+
run: dotnet test "$SOLUTION_FILE" --no-build

.github/workflows/sync-vendored-streaming-sdks.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: sync-vendored-streaming-sdks
1+
name: Sync Vendored Streaming SDKs
22

33
on:
44
workflow_dispatch:
@@ -12,15 +12,15 @@ jobs:
1212

1313
steps:
1414
- name: Check out repository
15-
uses: actions/checkout@v4
15+
uses: actions/checkout@v6
1616

1717
- name: Set up Python
18-
uses: actions/setup-python@v5
18+
uses: actions/setup-python@v6
1919
with:
2020
python-version: "3.12"
2121

2222
- name: Set up Node
23-
uses: actions/setup-node@v4
23+
uses: actions/setup-node@v6
2424
with:
2525
node-version: "20"
2626

@@ -33,7 +33,7 @@ jobs:
3333
run: python scripts/vendored_streaming_sdks.py verify
3434

3535
- name: Upload vendored SDK artifacts
36-
uses: actions/upload-artifact@v4
36+
uses: actions/upload-artifact@v7
3737
with:
3838
name: vendored-streaming-sdks
3939
path: |

.github/workflows/watch-vendored-streaming-sdks.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: watch-vendored-streaming-sdks
1+
name: Watch Vendored Streaming SDK Releases
22

33
on:
44
workflow_dispatch:
@@ -15,10 +15,10 @@ jobs:
1515

1616
steps:
1717
- name: Check out repository
18-
uses: actions/checkout@v4
18+
uses: actions/checkout@v6
1919

2020
- name: Set up Python
21-
uses: actions/setup-python@v5
21+
uses: actions/setup-python@v6
2222
with:
2323
python-version: "3.12"
2424

@@ -45,7 +45,7 @@ jobs:
4545
4646
- name: Create or update tracking issue
4747
if: steps.summary.outputs.has_updates == 'true'
48-
uses: actions/github-script@v7
48+
uses: actions/github-script@v8
4949
with:
5050
github-token: ${{ secrets.GITHUB_TOKEN }}
5151
script: |

AGENTS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,12 @@ Repo-specific design rules:
300300
- Any vendored runtime JavaScript SDK that tracks an upstream GitHub repo MUST have an automated watcher job that checks new GitHub releases and opens a repo issue describing the required update when a newer release appears.
301301
- Build quality gates must stay green under `-warnaserror`.
302302
- GitHub Pages is the expected CI publish target for the standalone WebAssembly app; publish automation must keep the app browser-only and Pages-compatible.
303+
- GitHub Actions MUST keep separate, clearly named workflows for pull-request validation and release automation; vague workflow names are forbidden.
304+
- Pull requests MUST have a dedicated validation workflow that runs the repo build and test gates before merge.
305+
- Releases MUST have a dedicated workflow that produces the release build, creates or updates the release tag, and publishes a GitHub Release with the release artifacts/notes.
306+
- The release workflow MUST be a full staged pipeline: build and tests first, then release publishing, and only then GitHub Pages deployment.
307+
- CI or deployment work is not done when GitHub Actions is merely green; the deployed GitHub Pages app MUST be opened and verified to boot without shell errors.
308+
- GitHub Pages deployment for `prompter.managed-code.com` MUST serve from the custom-domain root with `<base href="/">`; repo-name path prefixes are forbidden.
303309
- Version text shown in the app must come from automated build or release metadata, never from manually edited About copy.
304310
- The runtime must negotiate browser language from supported cultures and default to English.
305311
- Supported runtime cultures are English, Ukrainian, French, Spanish, Portuguese, and Italian.

0 commit comments

Comments
 (0)