go 0.1.1

A runtime-agnostic Go-style concurrency library for Rust
Documentation
name: Release

on:
  push:
    tags: ["v*"]

env:
  CARGO_TERM_COLOR: always

jobs:
  publish:
    name: Publish to crates.io
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2
      - name: Publish
        run: cargo publish
        env:
          CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

  github-release:
    name: Create GitHub Release
    runs-on: ubuntu-latest
    needs: publish
    permissions:
      contents: write
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - name: Generate changelog
        id: changelog
        run: |
          prev_tag=$(git tag --sort=-v:refname | sed -n '2p')
          if [ -z "$prev_tag" ]; then
            log=$(git log --oneline)
          else
            log=$(git log --oneline "${prev_tag}..HEAD")
          fi
          {
            echo 'body<<EOF'
            echo "$log"
            echo 'EOF'
          } >> "$GITHUB_OUTPUT"
      - name: Create release
        uses: softprops/action-gh-release@v2
        with:
          body: ${{ steps.changelog.outputs.body }}
          generate_release_notes: true