seva 0.1.3

Simple directory http server inspired by Python's http.server
on:
  workflow_run:
    workflows:
      - 'tests'
    types:
      - 'completed'
    branches:
      - 'main'

name: Create Release
permissions:
  contents: write

jobs:
  create_release:
    name: Create Release
    runs-on: ubuntu-latest
    timeout-minutes: 10
    outputs:
      created: ${{ steps.create_release_step.outputs.created }}
    steps:
      - uses: actions/checkout@v3
      - uses: dtolnay/rust-toolchain@stable

      - name: "cargo check"
        run: |
          cargo check

      - name: "create release"
        id: create_release_step
        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          bash .github/create_rel.sh

  crates_io_publish:
    name: Publish (crates.io)
    needs: create_release
    if: needs.create_release.outputs.created == 1
    runs-on: ubuntu-latest
    timeout-minutes: 10
    steps:
      - uses: actions/checkout@v3
      - uses: dtolnay/rust-toolchain@stable

      - name: cargo-release Cache
        id: cargo_release_cache
        uses: actions/cache@v3
        with:
          path: ~/.cargo/bin/cargo-release
          key: ${{ runner.os }}-cargo-release

      - run: cargo install cargo-release
        if: steps.cargo_release_cache.outputs.cache-hit != 'true'

      - name: cargo login
        run: cargo login ${{ secrets.CRATES_IO_API_TOKEN }}

      - name: "cargo release publish"
        run: |-
          cargo release \
            publish \
            --workspace \
            --all-features \
            --allow-branch main \
            --no-confirm \
            --execute