aoss-curl 1.0.25

Request to Amazon OpenSearch Service with SigV4 🔏
Documentation
name: CD

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

jobs:
  draft:
    name: Draft
    runs-on: ubuntu-latest
    steps:
      - name: Create draft release
        run: gh release create ${{ github.ref_name }} --draft --generate-notes --repo ${{ github.repository }}
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

  upload:
    name: Upload
    needs: draft
    strategy:
      matrix:
        include:
          - target: x86_64-unknown-linux-gnu
            os: ubuntu-latest
            command: cargo

          - target: aarch64-unknown-linux-gnu
            os: ubuntu-latest
            command: cross

          - target: x86_64-apple-darwin
            os: macos-latest
            command: cargo

          - target: aarch64-apple-darwin
            os: macos-latest
            command: cargo

    runs-on: ${{ matrix.os }}
    steps:
      - name: Checkout repository
        uses: actions/checkout@v6

      - name: Setup rust
        uses: dtolnay/rust-toolchain@stable
        with:
          target: ${{ matrix.target }}

      - name: Install cross
        run: cargo install cross
        if: matrix.command == 'cross'

      - name: Run ${{ matrix.command }} build
        run: ${{ matrix.command }} build --release --locked --target ${{ matrix.target }}

      - name: Upload artifact
        run: |
          cd target/${{ matrix.target }}/release
          tar czvf ../../../${{ matrix.target }}.gz ${{ github.event.repository.name }}
          cd -
          gh release upload ${{ github.ref_name }} ${{ matrix.target }}.gz
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

  publish:
    name: Publish
    needs: upload
    runs-on: ubuntu-latest
    environment: release
    steps:
      - name: Checkout repository
        uses: actions/checkout@v6

      - name: Setup rust
        uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt, clippy

      - name: Publish crate
        run: cargo publish --token ${{ secrets.CARGO_TOKEN }}

      - name: Publish release
        run: gh release edit ${{ github.ref_name }} --draft=false --repo ${{ github.repository }}
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}