fork 0.7.0

Library for creating a new process detached from the controlling terminal (daemon)
Documentation
---
name: Deploy

on:
  push:
    tags:
      - '*'
  workflow_dispatch:

permissions:
  contents: write

jobs:
  test:
    uses: ./.github/workflows/test.yml

  release:
    name: Create Release
    runs-on: ubuntu-latest
    needs: test
    steps:
      - name: Checkout sources
        uses: actions/checkout@v6

      - name: Get the release version from the tag
        run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV

      - name: Create Release
        uses: softprops/action-gh-release@v2
        with:
          name: Release ${{ env.VERSION }}
          draft: false
          prerelease: false
          generate_release_notes: true

  publish:
    name: Publish to crates.io
    runs-on: ubuntu-latest
    needs: test
    steps:
      - name: Checkout sources
        uses: actions/checkout@v6

      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable

      - run: cargo publish --token ${CRATES_TOKEN}
        env:
          CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }}