diff --git a/.github/workflows/draft-email.yml b/.github/workflows/draft-email.yml new file mode 100644 index 0000000..ec970d4 --- /dev/null +++ b/.github/workflows/draft-email.yml @@ -0,0 +1,44 @@ +name: Draft Email + +on: + pull_request: + types: [opened, synchronize] + branches: [main] + +jobs: + draft: + if: startsWith(github.head_ref, 'release-please--') + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: read + steps: + - uses: actions/checkout@v6 + with: + ref: ${{ github.head_ref }} + fetch-depth: 0 + + - name: Extract version from PR branch + id: version + run: | + VERSION=$(node -p "require('./package.json').version") + echo "value=$VERSION" >> "$GITHUB_OUTPUT" + + - name: Generate draft + uses: atriumn/cryyer/.github/actions/draft-file@v0 + id: draft + with: + product: tokencost + version: ${{ steps.version.outputs.value }} + llm-provider: gemini + llm-model: gemini-3-flash-preview + llm-api-key: ${{ secrets.GEMINI_API_KEY }} + + - name: Commit draft + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add drafts/ + git diff --cached --quiet && exit 0 + git commit -m "chore: draft email for v${{ steps.version.outputs.value }}" + git push diff --git a/.github/workflows/send-email.yml b/.github/workflows/send-email.yml new file mode 100644 index 0000000..a551a43 --- /dev/null +++ b/.github/workflows/send-email.yml @@ -0,0 +1,29 @@ +name: Send Email + +on: + release: + types: [published] + +jobs: + send: + runs-on: ubuntu-latest + environment: production + permissions: + contents: read + steps: + - uses: actions/checkout@v6 + + - name: Extract version + id: version + run: echo "value=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT" + + - name: Send email + uses: atriumn/cryyer/.github/actions/send-file@v0 + with: + product: tokencost + draft-path: drafts/v${{ steps.version.outputs.value }}.md + from-email: ${{ secrets.FROM_EMAIL }} + email-api-key: ${{ secrets.RESEND_API_KEY }} + subscriber-store: gist + github-gist-id: ${{ secrets.SUBSCRIBERS_GIST_ID }} + github-token: ${{ secrets.RELEASE_PLEASE_TOKEN }} diff --git a/drafts/.gitkeep b/drafts/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/products/tokencost.yaml b/products/tokencost.yaml new file mode 100644 index 0000000..0f01a99 --- /dev/null +++ b/products/tokencost.yaml @@ -0,0 +1,11 @@ +id: tokencost +name: tokencost +repo: atriumn/tokencost-dev +tagline: LLM Pricing Oracle — real model pricing data via MCP +voice: > + Concise and developer-friendly. Lead with what changed and why it matters. + Skip marketing fluff — our audience is technical users who integrate tokencost + into their AI workflows. Use plain language, short paragraphs, and bullet points. +emailSubjectTemplate: "tokencost {{version}} — what's new" +from_name: tokencost +reply_to: jeff@atriumn.com