Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 2
updates:
- package-ecosystem: pip
directory: /
schedule:
interval: weekly
groups:
python-build-tools:
patterns: ['*']
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
groups:
github-actions:
patterns: ['*']
19 changes: 14 additions & 5 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,36 @@
name: Check Agent Warcraft
on: [push, pull_request]
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node: [22, 24]
timeout-minutes: 20
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: ${{ matrix.node }}
- run: npm run check
- run: npm test
- run: npm run test:package
- uses: actions/setup-python@v7
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: '3.12'
- run: python -m pip install -r requirements-dev.txt
- run: python scripts/build-audio.py --check
- run: python scripts/check-pet.py
- run: python scripts/package-pet.py
- run: python scripts/build-assets.py --check
- run: python scripts/package-release.py
- run: npm run site
20 changes: 12 additions & 8 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ concurrency:
cancel-in-progress: true
jobs:
build:
timeout-minutes: 15
if: github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
permissions:
Expand All @@ -23,27 +24,30 @@ jobs:
id: release
env:
GH_TOKEN: ${{ github.token }}
# Before the first release, publish the pushed commit instead.
run: echo "tag=$(gh release view -R "$GITHUB_REPOSITORY" --json tagName --jq .tagName 2>/dev/null || true)" >> "$GITHUB_OUTPUT"
- uses: actions/checkout@v7
run: |
release_tag=$(gh api "repos/$GITHUB_REPOSITORY/releases/latest" --jq .tag_name)
test -n "$release_tag"
echo "tag=$release_tag" >> "$GITHUB_OUTPUT"
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ steps.release.outputs.tag }}
- uses: actions/setup-node@v7
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
- uses: actions/setup-python@v7
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: '3.12'
- run: npm run check
- run: npm test
- run: python -m pip install -r requirements-dev.txt
- run: python scripts/check-pet.py
- run: npm run site
- uses: actions/configure-pages@v5
- uses: actions/upload-pages-artifact@v4
- uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0
- uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
path: dist/site
deploy:
timeout-minutes: 10
needs: build
runs-on: ubuntu-latest
permissions:
Expand All @@ -54,5 +58,5 @@ jobs:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/deploy-pages@v4
- uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5.0.1
id: deployment
12 changes: 7 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,36 @@ concurrency:
cancel-in-progress: false
jobs:
verify:
timeout-minutes: 20
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node: [22, 24]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: ${{ matrix.node }}
- run: npm run check
- run: npm test
- run: npm run test:package
publish:
timeout-minutes: 15
needs: verify
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- name: Require a commit merged into main
run: git merge-base --is-ancestor HEAD origin/main
- uses: actions/setup-node@v7
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
- uses: actions/setup-python@v7
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: '3.12'
- run: python -m pip install -r requirements-dev.txt
Expand Down
22 changes: 18 additions & 4 deletions docs/distribution.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ changelog, and run the contributor checks. After its PR merges into `main`, tag
the merged commit and push the tag:

```bash
git tag v0.2.0
git push origin v0.2.0
release_tag="v$(node -p "require('./package.json').version")"
git tag "$release_tag"
git push origin "$release_tag"
```

The release workflow checks Node 22/24 on macOS, Linux, and Windows, including
Expand Down Expand Up @@ -89,8 +90,9 @@ No analytics, third-party fonts, or runtime telemetry are loaded; `site/fonts`
holds the OFL-licensed faces.

The Pages workflow checks out the latest published release tag, validates, and
builds before deployment. Before the first release it publishes the pushed
commit. It runs after successful releases, on main updates, or manually.
builds before deployment. A failed release lookup stops deployment; only
published release tags are deployed. It runs after successful releases, on
main updates, or manually.
The repository homepage points to `https://mitchtech.github.io/agent-warcraft/`.
Its social card is also available at
`https://mitchtech.github.io/agent-warcraft/previews/social.png`.
Expand Down Expand Up @@ -140,3 +142,15 @@ both characters before packaging. Preserve the source PNG in
`assets/original/peasant` and update `assets/peasant-pet-revision.json` when
replacing Peasant artwork. `agent-warcraft pet install peasant` installs it from the
package; the [Peasant guide](peasant.md) also describes manual installation.

## Automated maintenance

PR checks run the Node 22/24 matrix on Linux, macOS, and Windows, including
preview pixel verification and a full release package build. New commits
cancel superseded checks on the same PR. Release publication still requires
matching manifest/tag versions and a commit merged into `main`.

Dependabot checks Python build dependencies and GitHub Actions weekly, with
one grouped PR per ecosystem. Security updates remain enabled independently.
Actions use immutable commit pins with version comments so Dependabot can
update them. Review required checks before merging dependency updates.
8 changes: 4 additions & 4 deletions scripts/package-release.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def main():
if OUT.exists():
shutil.rmtree(OUT)
archive = pet.package(OUT, with_package=True)
version = json.loads((ROOT / "package.json").read_text())["version"]
version = json.loads((ROOT / "package.json").read_text(encoding="utf-8"))["version"]
if archive:
shutil.copyfile(archive, OUT / "agent-warcraft-pet.zip")
peasant_archive = pet.package(OUT, pet_id="peasant")
Expand Down Expand Up @@ -50,10 +50,10 @@ def main():
if web.exists():
shutil.copyfile(web, OUT / web.name)
artifacts = sorted(path for path in OUT.iterdir() if path.name != "SHA256SUMS")
(OUT / "SHA256SUMS").write_text("".join(f"{hashlib.sha256(path.read_bytes()).hexdigest()} {path.name}\n" for path in artifacts))
changelog = (ROOT / "CHANGELOG.md").read_text()
(OUT / "SHA256SUMS").write_text("".join(f"{hashlib.sha256(path.read_bytes()).hexdigest()} {path.name}\n" for path in artifacts), encoding="utf-8", newline="\n")
changelog = (ROOT / "CHANGELOG.md").read_text(encoding="utf-8")
section = changelog.split(f"## {version} - ", 1)[1].split("\n## ", 1)[0].split("\n", 1)[1].lstrip("\n")
(ROOT / "dist" / "release-notes.md").write_text(section)
(ROOT / "dist" / "release-notes.md").write_text(section, encoding="utf-8", newline="\n")
print(f"Built {len(artifacts)} release assets and checksums in {OUT}")


Expand Down
Loading