chore: bump version to 0.1.1 #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: release on version change | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - package.json | |
| workflow_dispatch: | |
| permissions: | |
| id-token: write | |
| contents: write | |
| pull-requests: write | |
| issues: write | |
| actions: read | |
| checks: read | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: detect version change | |
| id: version | |
| uses: actions/github-script@v8 | |
| with: | |
| script: | | |
| const fs = require("node:fs"); | |
| const childProcess = require("node:child_process"); | |
| const packageJson = JSON.parse(fs.readFileSync("package.json", "utf8")); | |
| const current = String(packageJson.version ?? ""); | |
| let previous = ""; | |
| try { | |
| const previousPackageJson = childProcess.execSync("git show HEAD^:package.json", { | |
| encoding: "utf8", | |
| }); | |
| const previousPackage = JSON.parse(previousPackageJson); | |
| previous = String(previousPackage.version ?? ""); | |
| } catch {} | |
| const changed = previous === "" || current !== previous; | |
| core.setOutput("current", current); | |
| core.setOutput("previous", previous); | |
| core.setOutput("changed", String(changed)); | |
| core.info(`current=${current} previous=${previous} changed=${changed}`); | |
| - name: check for existing release tag | |
| id: release_exists | |
| if: steps.version.outputs.changed == 'true' | |
| uses: actions/github-script@v8 | |
| with: | |
| script: | | |
| const tag = "v${{ steps.version.outputs.current }}"; | |
| let exists = false; | |
| try { | |
| await github.rest.repos.getReleaseByTag({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| tag, | |
| }); | |
| exists = true; | |
| } catch (error) { | |
| if (error.status !== 404) { | |
| throw error; | |
| } | |
| } | |
| core.setOutput("exists", String(exists)); | |
| core.info(`tag=${tag} exists=${exists}`); | |
| - name: generate changelog with pullfrog | |
| id: changelog | |
| if: steps.version.outputs.changed == 'true' && steps.release_exists.outputs.exists != 'true' | |
| uses: pullfrog/pullfrog@main | |
| with: | |
| agent: codex | |
| effort: auto | |
| timeout: 20m | |
| prompt: | | |
| Generate the release changelog markdown for version v${{ steps.version.outputs.current }}. | |
| Previous version from package.json is "${{ steps.version.outputs.previous }}". | |
| Requirements: | |
| - Read git history and summarize notable changes. | |
| - Keep output concise and factual. | |
| - Output valid markdown for a GitHub Release body. | |
| - Include these exact headings: | |
| ## highlights | |
| ## changes | |
| - Do not wrap the output in code fences. | |
| - call gh_pullfrog/set_output exactly once with the full markdown body. | |
| env: | |
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }} | |
| GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} | |
| CURSOR_API_KEY: ${{ secrets.CURSOR_API_KEY }} | |
| MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }} | |
| GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }} | |
| DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }} | |
| OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }} | |
| - name: create GitHub release | |
| if: steps.version.outputs.changed == 'true' && steps.release_exists.outputs.exists != 'true' | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: v${{ steps.version.outputs.current }} | |
| name: v${{ steps.version.outputs.current }} | |
| body: ${{ steps.changelog.outputs.result }} |