omnitrack 0.3.0

Universal issue-tracker provider contracts and clients (Linear, Jira, ...) for Rust, in one crate.
Documentation
name: release

on:
  push:
    tags:
      - "v[0-9]+.[0-9]+.[0-9]+"
      - "v[0-9]+.[0-9]+.[0-9]+-*"

permissions:
  contents: write
  pull-requests: read

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

      - name: Install Rust
        run: rustup toolchain install 1.89.0 --profile minimal && rustup default 1.89.0

      - name: Resolve version from tag
        id: plan
        run: |
          TAG="${GITHUB_REF_NAME}"
          VERSION="${TAG#v}"
          echo "tag=$TAG" >> "$GITHUB_OUTPUT"
          echo "version=$VERSION" >> "$GITHUB_OUTPUT"

      - name: Bump crate version
        run: |
          cargo install cargo-edit --locked
          cargo set-version "${{ steps.plan.outputs.version }}"
          cargo update --offline || cargo update

      - name: Install git-cliff
        uses: taiki-e/install-action@8f531eaecd1898bc3da7d104ad91bee98d1b97bd
        with:
          tool: git-cliff

      - name: Generate CHANGELOG
        env:
          GITHUB_TOKEN: ${{ github.token }}
        run: git-cliff --config cliff.toml --tag "${{ steps.plan.outputs.tag }}" --output CHANGELOG.md

      - name: Commit version bump and changelog
        run: |
          git config user.name "${GITHUB_ACTOR}"
          git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
          DEFAULT_BRANCH="$(git remote show origin | sed -n 's/.*HEAD branch: //p')"
          git add -A
          git diff --cached --quiet || git commit -m "chore(release): ${{ steps.plan.outputs.tag }}"
          git push origin "HEAD:${DEFAULT_BRANCH}" || true

      - name: Extract release notes
        id: notes
        env:
          GITHUB_TOKEN: ${{ github.token }}
        run: |
          {
            echo 'body<<EOF'
            git-cliff --config cliff.toml --latest --strip all
            echo 'EOF'
          } >> "$GITHUB_OUTPUT"

      - name: Create GitHub Release
        env:
          GH_TOKEN: ${{ github.token }}
        run: |
          gh release delete "${{ github.ref_name }}" --yes 2>/dev/null || true
          gh release create "${{ github.ref_name }}" \
            --title "${{ github.ref_name }}" \
            --notes "${{ steps.notes.outputs.body }}" \
            --latest

      - name: Send GitHub Release to Discord
        uses: SethCohen/github-releases-to-discord@24d166886aee4646d448c8a389ff9e1ebcab3682
        with:
          webhook_url: ${{ secrets.DISCORD }}
          release_name: ${{ github.ref_name }}
          release_body: ${{ steps.notes.outputs.body }}
          release_html_url: https://github.com/${{ github.repository }}/releases/tag/${{ github.ref_name }}
          color: "3447003"
          username: "GitHub Releases"
          avatar_url: "https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png"
          content: "New omnitrack-rs release published."
          footer_title: "akira-io/omnitrack-rs"
          footer_icon_url: "https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png"
          footer_timestamp: true