-
Notifications
You must be signed in to change notification settings - Fork 1
feat(launcher): replace Tauri prototype with egui + Azure Blob seed/patch manifest #343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
5fee345
feat(launcher): replace Tauri prototype with egui + Azure Blob seed/p…
BangRocket ec2e78d
fixup(launcher): PR #343 review feedback — quick wins + medium items
BangRocket e7e54dc
fix(launcher): re-patch SGW.exe when server_host changes + Cady #1 nits
BangRocket 9e01ffd
refactor(launcher): atomic writes, PathBuf, schema_version, ledger prune
BangRocket 44bcfb3
refactor(launcher): shared HTTP client, cancel-per-install, sha-keyed…
BangRocket ed8c7b7
feat(launcher): security hardening — single-instance lock, HTTPS-only…
BangRocket e300b5b
feat(launcher): manifest signing — Ed25519 detached signatures (Cady …
BangRocket af6db5e
feat(launcher): pivot content distribution to GitHub Releases (Cady #…
BangRocket 1e665e1
fix(launcher): CodeRabbit round-3 findings + Codecov
Cadacious 4bbf657
Merge origin/main + fix launcher coverage CI mold linker error
Cadacious c54087c
fix(launcher): gate localappdata test to Windows only
Cadacious File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| name: launcher | ||
|
|
||
| # Path-filtered: only runs when the launcher crate or its workflows change. | ||
| # The launcher is excluded from the main `ci` workflow (test.yml) because | ||
| # eframe brings in heavier system deps than the rest of the workspace and | ||
| # only matters on Windows. This workflow owns its full pipeline. | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| paths: | ||
| - 'crates/launcher/**' | ||
| - '.github/workflows/launcher-*.yml' | ||
| pull_request: | ||
| paths: | ||
| - 'crates/launcher/**' | ||
| - '.github/workflows/launcher-*.yml' | ||
|
|
||
| concurrency: | ||
| group: launcher-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| env: | ||
| CARGO_TERM_COLOR: always | ||
| CARGO_INCREMENTAL: 0 | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| fmt: | ||
| name: cargo fmt --check (launcher) | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
| components: rustfmt | ||
| - name: cargo fmt | ||
| run: | | ||
| if ! cargo fmt -p sgw-launcher -- --check; then | ||
| echo "::error::Formatting differs from rustfmt. Run 'cargo fmt -p sgw-launcher' locally and commit the result." | ||
| exit 1 | ||
| fi | ||
|
|
||
| clippy: | ||
| name: cargo clippy -D warnings (Windows) | ||
| runs-on: windows-latest | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
| components: clippy | ||
| - uses: Swatinem/rust-cache@v2 | ||
| with: | ||
| shared-key: launcher-windows | ||
| - name: cargo clippy | ||
| run: cargo clippy -p sgw-launcher --all-targets -- -D warnings | ||
|
|
||
| build: | ||
| name: cargo build (Windows) | ||
| runs-on: windows-latest | ||
| needs: clippy | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - uses: dtolnay/rust-toolchain@stable | ||
| - uses: Swatinem/rust-cache@v2 | ||
| with: | ||
| shared-key: launcher-windows | ||
| - name: cargo build | ||
| run: cargo build -p sgw-launcher --all-targets | ||
|
|
||
| test: | ||
| name: cargo nextest (Windows) | ||
| runs-on: windows-latest | ||
| needs: clippy | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - uses: dtolnay/rust-toolchain@stable | ||
| - uses: Swatinem/rust-cache@v2 | ||
| with: | ||
| shared-key: launcher-windows | ||
| - name: install nextest | ||
| uses: taiki-e/install-action@nextest | ||
| - name: cargo nextest run | ||
| run: cargo nextest run --profile=ci -p sgw-launcher |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,130 @@ | ||
| name: launcher-release-on-comment | ||
|
|
||
| # ChatOps trigger for launcher-release.yml. A maintainer comments | ||
| # `/release-launcher` on a merged PR and this workflow validates the | ||
| # comment and dispatches the launcher release workflow. | ||
| # | ||
| # Mirrors the structure of release-on-comment.yml (which handles the | ||
| # server container `/release` command). The two are intentionally | ||
| # separate so a server release and a launcher release can happen | ||
| # independently. | ||
|
|
||
| on: | ||
| issue_comment: | ||
| types: [created] | ||
|
|
||
| permissions: {} | ||
|
|
||
| concurrency: | ||
| group: launcher-release-comment-${{ github.event.issue.number }} | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| dispatch: | ||
| name: validate + dispatch launcher-release | ||
| if: | | ||
| github.event.issue.pull_request != null | ||
| && startsWith(github.event.comment.body, '/release-launcher') | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| issues: write | ||
| pull-requests: write | ||
| actions: write | ||
| contents: read | ||
| timeout-minutes: 10 | ||
| env: | ||
| GH_REPO: ${{ github.repository }} | ||
| steps: | ||
| - name: validate command shape | ||
| id: cmd | ||
| env: | ||
| BODY: ${{ github.event.comment.body }} | ||
| run: | | ||
| set -euo pipefail | ||
| FIRST_LINE=$(printf '%s' "$BODY" | head -n1) | ||
| if printf '%s' "$FIRST_LINE" | grep -Eq '^/release-launcher([[:space:]]|$)'; then | ||
| echo "matched=true" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "Comment starts with '/release-launcher' but isn't an exact command — skipping." | ||
| echo "matched=false" >> "$GITHUB_OUTPUT" | ||
| fi | ||
|
|
||
| - name: 👀 acknowledge receipt | ||
| if: steps.cmd.outputs.matched == 'true' | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| REPO: ${{ github.repository }} | ||
| COMMENT_ID: ${{ github.event.comment.id }} | ||
| run: | | ||
| gh api -X POST \ | ||
| "repos/${REPO}/issues/comments/${COMMENT_ID}/reactions" \ | ||
| -f content=eyes >/dev/null | ||
|
|
||
| - name: validate commenter has write access | ||
| if: steps.cmd.outputs.matched == 'true' | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| REPO: ${{ github.repository }} | ||
| ACTOR: ${{ github.event.comment.user.login }} | ||
| COMMENT_ID: ${{ github.event.comment.id }} | ||
| PR: ${{ github.event.issue.number }} | ||
| run: | | ||
| set -euo pipefail | ||
| PERM=$(gh api "repos/${REPO}/collaborators/${ACTOR}/permission" --jq '.permission') | ||
| echo "actor=${ACTOR} permission=${PERM}" | ||
| case "$PERM" in | ||
| admin|maintain|write) echo "ok" ;; | ||
| *) | ||
| gh api -X POST \ | ||
| "repos/${REPO}/issues/comments/${COMMENT_ID}/reactions" \ | ||
| -f content=-1 >/dev/null | ||
| gh pr comment "$PR" \ | ||
| --body "@${ACTOR} \`/release-launcher\` requires repo write permission. (You have \`${PERM}\`.)" | ||
| exit 1 | ||
| ;; | ||
| esac | ||
|
|
||
| - name: ensure PR is merged | ||
| if: steps.cmd.outputs.matched == 'true' | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| REPO: ${{ github.repository }} | ||
| COMMENT_ID: ${{ github.event.comment.id }} | ||
| PR: ${{ github.event.issue.number }} | ||
| run: | | ||
| set -euo pipefail | ||
| MERGED=$(gh api "repos/${REPO}/pulls/${PR}" --jq '.merged') | ||
| if [ "$MERGED" != "true" ]; then | ||
| gh api -X POST \ | ||
| "repos/${REPO}/issues/comments/${COMMENT_ID}/reactions" \ | ||
| -f content=-1 >/dev/null | ||
| gh pr comment "$PR" \ | ||
| --body "Can't \`/release-launcher\` from an open PR. Merge first, then comment \`/release-launcher\` again — the launcher release workflow always builds from \`main\` HEAD, so it needs the merge to be in main." | ||
| exit 1 | ||
| fi | ||
|
|
||
| - name: dispatch launcher-release.yml | ||
| if: steps.cmd.outputs.matched == 'true' | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| PR: ${{ github.event.issue.number }} | ||
| run: | | ||
| gh workflow run launcher-release.yml \ | ||
| --ref main \ | ||
| -f "triggering_pr=${PR}" | ||
|
|
||
| - name: 🚀 acknowledge dispatch | ||
| if: steps.cmd.outputs.matched == 'true' | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| REPO: ${{ github.repository }} | ||
| COMMENT_ID: ${{ github.event.comment.id }} | ||
| PR: ${{ github.event.issue.number }} | ||
| ACTOR: ${{ github.event.comment.user.login }} | ||
| SERVER_URL: ${{ github.server_url }} | ||
| run: | | ||
| gh api -X POST \ | ||
| "repos/${REPO}/issues/comments/${COMMENT_ID}/reactions" \ | ||
| -f content=rocket >/dev/null | ||
| gh pr comment "$PR" \ | ||
| --body "🚀 Launcher release dispatched by @${ACTOR}. Watch [launcher-release runs](${SERVER_URL}/${REPO}/actions/workflows/launcher-release.yml)." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| name: launcher-release | ||
|
|
||
| # Builds and publishes a GitHub Release containing the launcher .exe. | ||
| # Triggered either manually via the Actions UI (`workflow_dispatch`) or | ||
| # via the `/release-launcher` ChatOps command on a merged PR, which | ||
| # dispatches this workflow through `launcher-release-on-comment.yml`. | ||
| # | ||
| # Always builds whatever is at `main` HEAD — the triggering PR is just | ||
| # the cut-point marker, mirroring the policy of `release-container.yml`. | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| triggering_pr: | ||
| description: 'PR # that triggered this release (informational, optional)' | ||
| required: false | ||
|
|
||
| permissions: {} | ||
|
|
||
| concurrency: | ||
| group: launcher-release | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| release: | ||
| name: build + publish (Windows) | ||
| runs-on: windows-latest | ||
| permissions: | ||
| contents: write | ||
| timeout-minutes: 45 | ||
| env: | ||
| CARGO_TERM_COLOR: always | ||
| CARGO_INCREMENTAL: 0 | ||
| # Baked into the binary at compile time via option_env!. The release | ||
| # job is the only place this secret is referenced; PR / build jobs | ||
| # produce non-uploading binaries. | ||
| LAUNCHER_LOG_SAS_URL: ${{ secrets.LAUNCHER_LOG_SAS_URL }} | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| ref: main | ||
| - uses: dtolnay/rust-toolchain@stable | ||
| - uses: Swatinem/rust-cache@v2 | ||
| with: | ||
| shared-key: launcher-release | ||
| - name: cargo build --release | ||
| run: cargo build -p sgw-launcher --release | ||
| - name: stamp version | ||
| id: stamp | ||
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
| SHORT_SHA="${GITHUB_SHA:0:7}" | ||
| DATE=$(date -u +%Y%m%d) | ||
| TAG="launcher-${DATE}-${SHORT_SHA}" | ||
| echo "tag=${TAG}" >> "$GITHUB_OUTPUT" | ||
| echo "short_sha=${SHORT_SHA}" >> "$GITHUB_OUTPUT" | ||
| - name: stage artifact | ||
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
| mkdir -p artifacts | ||
| cp target/release/sgw-launcher.exe \ | ||
| "artifacts/sgw-launcher-${{ steps.stamp.outputs.tag }}.exe" | ||
| - name: upload build artifact (workflow run) | ||
| uses: actions/upload-artifact@v7 | ||
| with: | ||
| name: sgw-launcher-${{ steps.stamp.outputs.tag }} | ||
| path: artifacts/sgw-launcher-${{ steps.stamp.outputs.tag }}.exe | ||
| retention-days: 30 | ||
| - name: create GitHub release | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| GH_REPO: ${{ github.repository }} | ||
| TRIGGERING_PR: ${{ github.event.inputs.triggering_pr }} | ||
| TAG: ${{ steps.stamp.outputs.tag }} | ||
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
| BODY="Stargate Worlds launcher build from commit \`${GITHUB_SHA}\`." | ||
| if [ -n "${TRIGGERING_PR}" ]; then | ||
| BODY="${BODY} | ||
|
|
||
| Dispatched from PR #${TRIGGERING_PR}." | ||
| fi | ||
| gh release create "${TAG}" \ | ||
| --title "Launcher ${TAG}" \ | ||
| --notes "${BODY}" \ | ||
| "artifacts/sgw-launcher-${TAG}.exe" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.