chore: release v2.15.0 (#462) #82
Workflow file for this run
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: publish-cli | |
| permissions: | |
| contents: write | |
| on: | |
| push: | |
| tags: ["v*"] | |
| workflow_dispatch: | |
| concurrency: | |
| group: publish-cli-${{ github.ref_name }} | |
| env: | |
| CARGO_INCREMENTAL: 0 | |
| CARGO_TERM_COLOR: always | |
| DRY_RUN: ${{ !startsWith(github.ref, 'refs/tags/v') }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NPM_CONFIG_FUND: false | |
| jobs: | |
| create-release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 | |
| with: | |
| submodules: recursive | |
| fetch-depth: 0 | |
| - uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac # v2 | |
| - name: Install Claude Code CLI | |
| if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
| run: npm install -g @anthropic-ai/claude-code | |
| - name: Create draft release | |
| if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
| run: | | |
| TAG_NAME="${{ github.ref_name }}" | |
| PREV_TAG="$(git describe --tags --abbrev=0 "$TAG_NAME^" 2>/dev/null || echo "")" | |
| RELEASE_TITLE="$TAG_NAME" | |
| # Generate rich release notes using LLM | |
| if [[ -n "${ANTHROPIC_API_KEY:-}" ]]; then | |
| if ./scripts/gen-release-notes.sh "$TAG_NAME" "$PREV_TAG" >/tmp/release-notes-full.txt; then | |
| # First line is pithy title, rest is body | |
| PITHY_TITLE="$(head -n1 /tmp/release-notes-full.txt)" | |
| # Only concatenate if we got a real title (not just the version fallback) | |
| if [[ -n "$PITHY_TITLE" && "$PITHY_TITLE" != "$TAG_NAME" ]]; then | |
| RELEASE_TITLE="$TAG_NAME: $PITHY_TITLE" | |
| fi | |
| tail -n +2 /tmp/release-notes-full.txt >/tmp/release-notes.txt | |
| else | |
| echo "LLM generation failed, falling back to CHANGELOG.md" | |
| awk '/^## \[/{if(found) exit; found=1} found{print}' CHANGELOG.md >/tmp/release-notes.txt | |
| fi | |
| else | |
| echo "ANTHROPIC_API_KEY not set, using CHANGELOG.md" | |
| awk '/^## \[/{if(found) exit; found=1} found{print}' CHANGELOG.md >/tmp/release-notes.txt | |
| fi | |
| gh release create --draft ${{ github.ref_name }} \ | |
| --title "$RELEASE_TITLE" \ | |
| --notes-file /tmp/release-notes.txt | |
| env: | |
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | |
| build-and-publish: | |
| needs: [create-release] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - target: universal-apple-darwin | |
| os: macos-latest | |
| build-tool: cargo | |
| - target: x86_64-unknown-linux-gnu | |
| os: ubuntu-latest | |
| build-tool: cross | |
| - target: x86_64-unknown-linux-musl | |
| os: ubuntu-latest | |
| build-tool: cross | |
| - target: aarch64-unknown-linux-gnu | |
| os: ubuntu-latest | |
| build-tool: cross | |
| - target: aarch64-unknown-linux-musl | |
| os: ubuntu-latest | |
| build-tool: cross | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 | |
| with: | |
| submodules: recursive | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac # v2 | |
| with: | |
| experimental: true | |
| - if: matrix.os == 'macos-latest' | |
| uses: apple-actions/import-codesign-certs@95e84a1a18f2bdbc5c6ab9b7f4429372e4b13a8b # v5 | |
| with: | |
| p12-file-base64: ${{ secrets.APPLE_DEVELOPER_ID_APPLICATION_CERTS_P12 }} | |
| p12-password: ${{ secrets.APPLE_DEVELOPER_ID_APPLICATION_CERTS_P12_PASS }} | |
| - uses: taiki-e/upload-rust-binary-action@3962470d6e7f1993108411bc3f75a135ec67fc8c # v1 | |
| with: | |
| bin: usage | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| target: ${{ matrix.target }} | |
| build-tool: ${{ matrix.build-tool }} | |
| manifest-path: cli/Cargo.toml | |
| include: cli/assets/usage.1 | |
| codesign: "Developer ID Application: Jeffrey Dickey (4993Y37DX6)" | |
| codesign_prefix: dev.jdx. | |
| dry-run: ${{ github.event_name == 'workflow_dispatch' }} | |
| env: | |
| CARGO_PROFILE_RELEASE_CODEGEN_UNITS: 1 | |
| CARGO_PROFILE_RELEASE_LTO: true | |
| release: | |
| runs-on: ubuntu-latest | |
| needs: [build-and-publish] | |
| if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 | |
| with: | |
| submodules: recursive | |
| - uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac # v2 | |
| - run: gh release edit ${{ github.ref_name }} --draft=false | |
| if: ${{ github.event_name != 'workflow_dispatch' }} | |
| # bump-homebrew-formula: | |
| # runs-on: macos-latest | |
| # needs: [release] | |
| # timeout-minutes: 10 | |
| # continue-on-error: true | |
| # if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
| # steps: | |
| # - name: Bump Homebrew formula | |
| # uses: dawidd6/action-homebrew-bump-formula@3428a0601bba3173ec0bdcc945be23fa27aa4c31 # v5 | |
| # with: | |
| # token: ${{ secrets.GH_BOT_TOKEN }} | |
| # formula: usage |