-
Notifications
You must be signed in to change notification settings - Fork 0
updates #1
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
base: main
Are you sure you want to change the base?
updates #1
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,9 +8,14 @@ permissions: | |
| contents: write | ||
|
|
||
| env: | ||
| # Ref of gameap/gameap providing web/plugin-sdk (0.3.3+: contentType 'none', | ||
| # fileSize/fileMtime props) and the panel that streams HTTPResponse.file. | ||
| GAMEAP_REF: main | ||
| # Ref of gameap/gameap-proto providing rust/gameap-plugin-sdk; pin to a SHA if | ||
| # the SDK drifts from Cargo.lock | ||
| GAMEAP_PROTO_REF: main | ||
| # the SDK drifts from Cargo.lock. Pinned to the head of the proto-updates | ||
| # branch: HTTPResponse.file / FileRef, which src/http.rs sets, is not on main | ||
| # yet. Restore `main` once proto-updates is merged. | ||
| GAMEAP_PROTO_REF: aba9a6c002358ed56691ff1f5c28d448e5f2cdee | ||
|
|
||
| jobs: | ||
| publish: | ||
|
|
@@ -19,19 +24,28 @@ jobs: | |
| - uses: actions/checkout@v4 | ||
| with: | ||
| path: plugin-hex-editor | ||
| persist-credentials: false | ||
|
|
||
| # The frontend depends on file:../../gameap-api/web/plugin-sdk, so the | ||
| # gameap repo must be checked out as a sibling directory named gameap-api | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| repository: gameap/gameap | ||
| ref: ${{ env.GAMEAP_REF }} | ||
| path: gameap-api | ||
| persist-credentials: false | ||
|
|
||
| # Cargo.toml depends on path = "../gameap-proto/rust/gameap-plugin-sdk" | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| repository: gameap/gameap-proto | ||
| ref: ${{ env.GAMEAP_PROTO_REF }} | ||
| path: gameap-proto | ||
| persist-credentials: false | ||
|
|
||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 22 | ||
| cache: npm | ||
| cache-dependency-path: plugin-hex-editor/frontend/package-lock.json | ||
|
|
||
| # Bakes the release tag into Cargo.toml version (which get_info reads via | ||
| # CARGO_PKG_VERSION) and the frontend PluginDefinition before anything is built. | ||
|
|
@@ -40,18 +54,39 @@ jobs: | |
| env: | ||
| TAG: ${{ github.event.release.tag_name }} | ||
| run: | | ||
| # Only a plain semver tag (optional v prefix, optional pre-release) | ||
| # reaches sed: no slashes, ampersands or other replacement syntax. | ||
| if ! printf '%s' "$TAG" | grep -Eq '^v?[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$'; then | ||
| echo "::error::release tag '$TAG' is not a semver tag (expected v1.2.3 or v1.2.3-rc.1)" | ||
| exit 1 | ||
| fi | ||
| VERSION="${TAG#v}" | ||
| sed -i "s/^version = \".*\"$/version = \"${VERSION}\"/" Cargo.toml | ||
| sed -i "s/^ version: '.*',$/ version: '${VERSION}',/" frontend/src/index.ts | ||
| grep -q "^version = \"${VERSION}\"$" Cargo.toml | ||
| grep -q "version: '${VERSION}'," frontend/src/index.ts | ||
|
|
||
| # See the same step in build.yml for why @gameap/ui is installed over | ||
| # the npm tarball and why a shim declaration is written. | ||
| - name: Build plugin SDK | ||
| working-directory: gameap-api/web/plugin-sdk | ||
| run: | | ||
| npm ci | ||
| npm install --no-save ../frontend/packages/gameap-ui | ||
| echo "declare module '@gameap/ui';" > src/gameap-ui-shim.d.ts | ||
| npx vite build | ||
| npx tsc --emitDeclarationOnly | ||
|
|
||
| - name: Build frontend | ||
| working-directory: plugin-hex-editor/frontend | ||
| run: | | ||
| npm ci | ||
| npm run build | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- release workflow ---'
sed -n '1,130p' .github/workflows/release.yml
printf '%s\n' '--- package scripts ---'
node -e 'const p=require("./package.json"); console.log(JSON.stringify(p.scripts, null, 2))'
printf '%s\n' '--- typecheck configuration ---'
find . -maxdepth 2 -type f \( -name 'tsconfig*.json' -o -name 'vite.config.*' \) -print
for f in $(find . -maxdepth 2 -type f \( -name 'tsconfig*.json' -o -name 'vite.config.*' \)); do
echo "--- $f"
sed -n '1,180p' "$f"
doneRepository: gameap/plugin-hex-editor Length of output: 5713 🤖 get_repo_knowledge executed:
Length of output: 120 🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- frontend package scripts ---'
node -e 'const p=require("./frontend/package.json"); console.log(JSON.stringify(p.scripts, null, 2))'
printf '%s\n' '--- frontend typecheck/build configuration ---'
find frontend -maxdepth 2 -type f \( -name 'tsconfig*.json' -o -name 'vite.config.*' \) -print
for f in $(find frontend -maxdepth 2 -type f \( -name 'tsconfig*.json' -o -name 'vite.config.*' \)); do
echo "--- $f"
sed -n '1,180p' "$f"
done
printf '%s\n' '--- analogous build workflow steps ---'
rg -n -C 4 'npm run (build|typecheck)|npx tsc|Build frontend' .github/workflowsRepository: gameap/plugin-hex-editor Length of output: 8763 Run the frontend typecheck before publishing.
Proposed change npm ci
npm run build
+ npm run typecheck🤖 Prompt for AI Agents |
||
|
|
||
| - name: Test frontend | ||
| working-directory: plugin-hex-editor/frontend | ||
| run: npm test | ||
|
|
||
| - name: Install binaryen | ||
| run: sudo apt-get update && sudo apt-get install -y binaryen | ||
|
|
||
|
|
@@ -64,6 +99,10 @@ jobs: | |
| with: | ||
| workspaces: plugin-hex-editor | ||
|
|
||
| - name: Test | ||
| working-directory: plugin-hex-editor | ||
| run: cargo test | ||
|
|
||
| - name: Build wasm | ||
| working-directory: plugin-hex-editor | ||
| run: make wasm | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,7 @@ | ||
| /target | ||
| *.wasm | ||
| frontend/dist | ||
| !frontend/dist/.gitkeep | ||
| frontend/node_modules | ||
| /hex-editor.wasm | ||
| *.wasm.asc | ||
| /frontend/dist | ||
| /frontend/node_modules | ||
| .idea/ | ||
| .DS_Store |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: gameap/plugin-hex-editor
Length of output: 19483
🏁 Script executed:
Repository: gameap/plugin-hex-editor
Length of output: 35361
Pin
GAMEAP_REFto an immutable commit.Both workflows check out
gameap/gameapat movingmainand build its local Plugin SDK. The frontend then imports that SDK, so later upstream changes can alter CI and frontend release output without a review here. Use the same reviewed commit SHA in both workflow files.📍 Affects 2 files
.github/workflows/release.yml#L13-L13(this comment).github/workflows/build.yml#L16-L16🤖 Prompt for AI Agents