dylib_installer 0.1.0

A tool to install dylib files and header to system library path.
name: Release

on:
  push:
    branches:
      - main
    tags:
      - 'v*'

jobs:
  release:
    if: startsWith(github.ref, 'refs/tags/v') && github.event_name == 'push'
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Set up Rust toolchain
        uses: actions-rs/toolchain@v1
        with:
          toolchain: stable
          profile: minimal
          override: true
      - name: Cache Cargo Registry
        uses: actions/cache@v3
        with:
          path: |
            ~/.cargo/registry
            ~/.cargo/git
            target
          key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
      - name: Build and Test
        run: |
          cargo build --release --verbose
          cargo test --verbose
      - name: Create Release
        uses: softprops/action-gh-release@v1
        with:
          files: target/release/dylib_installer
        env:
          GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
      - name: Publish to Crates.io
        uses: actions-rs/cargo@v1
        with:
          command: publish
          args: --token ${{ secrets.CARGO_TOKEN }}
        env:
          CARGO_REGISTERY_TOKEN: ${{ secrets.CARGO_TOKEN }}