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
41 changes: 0 additions & 41 deletions .github/prompts/classify-pr.prompt.yml

This file was deleted.

36 changes: 0 additions & 36 deletions .github/prompts/detect-breaking.prompt.yml

This file was deleted.

20 changes: 0 additions & 20 deletions .github/prompts/summarize-changelog.prompt.yml

This file was deleted.

41 changes: 0 additions & 41 deletions .github/workflows/ai-labeler.yml

This file was deleted.

68 changes: 1 addition & 67 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ jobs:
environment: release
permissions:
contents: write
models: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
Expand All @@ -101,77 +100,12 @@ jobs:
exit 1
fi

- name: Build changelog context
run: |
PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
DIFF_FILE=/tmp/diff.txt
if [ -z "$PREV_TAG" ]; then
COMMITS=$(git log --oneline --no-decorate)
git diff --stat 4b825dc642cb6eb9a060e54bf899d69f82a3ef17 HEAD > "$DIFF_FILE"
else
COMMITS=$(git log --oneline --no-decorate "${PREV_TAG}..HEAD")
git diff "${PREV_TAG}..HEAD" -- '*.go' 'go.mod' > "$DIFF_FILE"
fi
{
echo "Commits:"
echo "$COMMITS"
echo ""
echo "Diff summary:"
head -c 80000 "$DIFF_FILE"
} > /tmp/user-message.txt
# Splice into prompt YAML
python3 -c "
with open('.github/prompts/summarize-changelog.prompt.yml') as f:
lines = f.readlines()
with open('/tmp/user-message.txt') as f:
user_msg = f.read()
insert_at = len(lines)
for i, line in enumerate(lines):
if i == 0: continue
if line.strip() and not line[0].isspace():
insert_at = i
break
entry = [' - role: user\n', ' content: |\n']
for ln in user_msg.splitlines():
entry.append(' ' + ln + '\n')
lines[insert_at:insert_at] = entry
with open('/tmp/prompt.yml', 'w') as f:
f.writelines(lines)
try:
import yaml
doc = yaml.safe_load(open('/tmp/prompt.yml'))
assert doc['messages'][-1]['role'] == 'user', 'prompt splice failed'
except ImportError:
pass
"
continue-on-error: true

- name: Generate AI changelog
id: ai-changelog
uses: actions/ai-inference@e09e65981758de8b2fdab13c2bfb7c7d5493b0b6 # v2.0.7
continue-on-error: true
with:
prompt-file: /tmp/prompt.yml

- name: Create GitHub Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CHANGELOG_FILE: ${{ steps.ai-changelog.outputs.response-file }}
TAG: ${{ github.ref_name }}
run: |
NOTES=""
if [ -n "$CHANGELOG_FILE" ] && [ -f "$CHANGELOG_FILE" ]; then
sed -i '/^```\(markdown\)\?$/d' "$CHANGELOG_FILE"
CHANGELOG=$(cat "$CHANGELOG_FILE")
if [ -n "$CHANGELOG" ]; then
NOTES="${CHANGELOG}

---

"
fi
fi
NOTES="${NOTES}### Install
NOTES="### Install

\`\`\`
go get github.com/basecamp/cli@${TAG}
Expand Down
10 changes: 0 additions & 10 deletions prompts/seed-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,8 @@ You are creating a new Go CLI for a 37signals product using the seed templates.
│ │ ├── test.yml
│ │ ├── security.yml
│ │ ├── release.yml
│ │ ├── ai-labeler.yml
│ │ ├── dependabot-auto-merge.yml
│ │ └── labeler.yml
│ ├── prompts/
│ │ ├── classify-pr.prompt.yml
│ │ ├── detect-breaking.prompt.yml
│ │ └── summarize-changelog.prompt.yml
│ ├── codeql/
│ │ └── codeql-config.yml
│ ├── CODEOWNERS
Expand Down Expand Up @@ -107,7 +102,6 @@ You are creating a new Go CLI for a 37signals product using the seed templates.
- `seed/.github/workflows/test.yml` → `.github/workflows/test.yml` (update env vars, GOPRIVATE)
- `seed/.github/workflows/security.yml` → `.github/workflows/security.yml`
- `seed/.github/workflows/release.yml` → `.github/workflows/release.yml` (update env vars)
- `seed/.github/workflows/ai-labeler.yml` → `.github/workflows/ai-labeler.yml`
- `seed/.github/workflows/dependabot-auto-merge.yml` → `.github/workflows/dependabot-auto-merge.yml`
- `seed/.github/workflows/labeler.yml` → `.github/workflows/labeler.yml`
- `seed/.github/dependabot.yml` → `.github/dependabot.yml`
Expand All @@ -116,9 +110,6 @@ You are creating a new Go CLI for a 37signals product using the seed templates.
- `seed/.github/release.yml` → `.github/release.yml`
- `seed/.github/labeler.yml.tmpl` → `.github/labeler.yml` (customize label rules)
- `seed/.github/codeql/codeql-config.yml` → `.github/codeql/codeql-config.yml`
- `seed/.github/prompts/classify-pr.prompt.yml` → `.github/prompts/classify-pr.prompt.yml`
- `seed/.github/prompts/detect-breaking.prompt.yml` → `.github/prompts/detect-breaking.prompt.yml`
- `seed/.github/prompts/summarize-changelog.prompt.yml` → `.github/prompts/summarize-changelog.prompt.yml`

**Local dev config:**
- `seed/.pre-commit-config.yaml.tmpl` → `.pre-commit-config.yaml` (fill in env var name)
Expand Down Expand Up @@ -150,7 +141,6 @@ After the repo is pushed to GitHub:
| Feature | What to configure |
|---------|-------------------|
| Private module access | `vars.RELEASE_CLIENT_ID` + `secrets.RELEASE_APP_PRIVATE_KEY` |
| AI changelog | `vars.ENABLE_AI_CHANGELOG=true` |
| macOS notarization | 5 secrets in `release` environment |
| Homebrew tap | `secrets.HOMEBREW_TAP_TOKEN` |
| AUR publish | `secrets.AUR_SSH_KEY` |
Expand Down
41 changes: 0 additions & 41 deletions seed/.github/prompts/classify-pr.prompt.yml

This file was deleted.

34 changes: 0 additions & 34 deletions seed/.github/prompts/detect-breaking.prompt.yml

This file was deleted.

20 changes: 0 additions & 20 deletions seed/.github/prompts/summarize-changelog.prompt.yml

This file was deleted.

Loading
Loading