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
24 changes: 24 additions & 0 deletions .github/workflows/squad-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Squad CI

on:
pull_request:
branches: [dev, preview, main]
types: [opened, synchronize, reopened]
push:
branches: [dev]

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 22

- name: Run tests
run: node --test test/*.test.js
38 changes: 38 additions & 0 deletions .github/workflows/squad-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Squad Preview Validation

on:
push:
branches: [preview]

permissions:
contents: read

jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 22

- name: Run tests
run: node --test test/*.test.js

- name: Check no .ai-team/ files are tracked
run: |
if git ls-files --error-unmatch .ai-team/ 2>/dev/null; then
echo "::error::❌ .ai-team/ files are tracked on preview — this must not ship."
exit 1
fi
echo "✅ No .ai-team/ files tracked — clean for release."

- name: Validate package.json version
run: |
VERSION=$(node -e "console.log(require('./package.json').version)")
if [ -z "$VERSION" ]; then
echo "::error::❌ No version field found in package.json."
exit 1
fi
echo "✅ package.json version: $VERSION"
68 changes: 68 additions & 0 deletions .github/workflows/squad-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Squad Release

on:
push:
branches: [main]

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-node@v4
with:
node-version: 22

- name: Run tests
run: node --test test/*.test.js

- name: Read version from package.json
id: version
run: |
VERSION=$(node -e "console.log(require('./package.json').version)")
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "tag=v$VERSION" >> "$GITHUB_OUTPUT"
echo "📦 Version: $VERSION (tag: v$VERSION)"

- name: Check if tag already exists
id: check_tag
run: |
if git rev-parse "refs/tags/${{ steps.version.outputs.tag }}" >/dev/null 2>&1; then
echo "exists=true" >> "$GITHUB_OUTPUT"
echo "⏭️ Tag ${{ steps.version.outputs.tag }} already exists — skipping release."
else
echo "exists=false" >> "$GITHUB_OUTPUT"
echo "🆕 Tag ${{ steps.version.outputs.tag }} does not exist — creating release."
fi

- name: Create git tag
if: steps.check_tag.outputs.exists == 'false'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag -a "${{ steps.version.outputs.tag }}" -m "Release ${{ steps.version.outputs.tag }}"
git push origin "${{ steps.version.outputs.tag }}"

- name: Create GitHub Release
if: steps.check_tag.outputs.exists == 'false'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create "${{ steps.version.outputs.tag }}" \
--title "${{ steps.version.outputs.tag }}" \
--generate-notes \
--latest

- name: Verify release
if: steps.check_tag.outputs.exists == 'false'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release view "${{ steps.version.outputs.tag }}"
echo "✅ Release ${{ steps.version.outputs.tag }} created and verified."
24 changes: 24 additions & 0 deletions templates/workflows/squad-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Squad CI

on:
pull_request:
branches: [dev, preview, main]
types: [opened, synchronize, reopened]
push:
branches: [dev]

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 22

- name: Run tests
run: node --test test/*.test.js
38 changes: 38 additions & 0 deletions templates/workflows/squad-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Squad Preview Validation

on:
push:
branches: [preview]

permissions:
contents: read

jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 22

- name: Run tests
run: node --test test/*.test.js

- name: Check no .ai-team/ files are tracked
run: |
if git ls-files --error-unmatch .ai-team/ 2>/dev/null; then
echo "::error::❌ .ai-team/ files are tracked on preview — this must not ship."
exit 1
fi
echo "✅ No .ai-team/ files tracked — clean for release."

- name: Validate package.json version
run: |
VERSION=$(node -e "console.log(require('./package.json').version)")
if [ -z "$VERSION" ]; then
echo "::error::❌ No version field found in package.json."
exit 1
fi
echo "✅ package.json version: $VERSION"
68 changes: 68 additions & 0 deletions templates/workflows/squad-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Squad Release

on:
push:
branches: [main]

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-node@v4
with:
node-version: 22

- name: Run tests
run: node --test test/*.test.js

- name: Read version from package.json
id: version
run: |
VERSION=$(node -e "console.log(require('./package.json').version)")
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "tag=v$VERSION" >> "$GITHUB_OUTPUT"
echo "📦 Version: $VERSION (tag: v$VERSION)"

- name: Check if tag already exists
id: check_tag
run: |
if git rev-parse "refs/tags/${{ steps.version.outputs.tag }}" >/dev/null 2>&1; then
echo "exists=true" >> "$GITHUB_OUTPUT"
echo "⏭️ Tag ${{ steps.version.outputs.tag }} already exists — skipping release."
else
echo "exists=false" >> "$GITHUB_OUTPUT"
echo "🆕 Tag ${{ steps.version.outputs.tag }} does not exist — creating release."
fi

- name: Create git tag
if: steps.check_tag.outputs.exists == 'false'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag -a "${{ steps.version.outputs.tag }}" -m "Release ${{ steps.version.outputs.tag }}"
git push origin "${{ steps.version.outputs.tag }}"

- name: Create GitHub Release
if: steps.check_tag.outputs.exists == 'false'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create "${{ steps.version.outputs.tag }}" \
--title "${{ steps.version.outputs.tag }}" \
--generate-notes \
--latest

- name: Verify release
if: steps.check_tag.outputs.exists == 'false'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release view "${{ steps.version.outputs.tag }}"
echo "✅ Release ${{ steps.version.outputs.tag }} created and verified."
Loading