mir 0.4.1

Tool to mirror a user's entire accessible GitLab group hierarchy locally and optionally clone all projects.
name: Release

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

env:
  CARGO_TERM_COLOR: always

jobs:
  build:
    strategy:
      matrix:
        platform: [macos-latest, windows-latest]
    runs-on: ${{ matrix.platform }}
    steps:
      - uses: actions/checkout@v3
      - name: Build
        shell: bash
        run: |
          BINARY_NAME=mir
          if [[ ${{ startsWith(matrix.platform, 'windows') }} == true ]]
          then
            BINARY_NAME=${BINARY_NAME}.exe
          fi
          cargo build --release --verbose
          cp target/release/${BINARY_NAME} ./
          tar czf mir-${{ runner.os }}-${{ runner.arch }}.tar.gz ${BINARY_NAME}
      - name: Upload Build Artifact
        uses: actions/upload-artifact@v3.1.0
        with:
          path: '*.tar.gz'

  publish:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Publish to crates.io
        run: |
          sed -i "s/version = \"0.0.0\"/version = \"${{ github.ref_name }}\"/" Cargo.toml
          cargo login ${{ secrets.CRATES_IO_API_TOKEN }}
          cargo publish --allow-dirty --verbose

  release:
    runs-on: ubuntu-latest
    needs: [build]
    steps:
      - name: Download Build Artifacts
        uses: actions/download-artifact@v3.0.0
      - name: DEBUG
        run: find .
        shell: bash
      - name: Release
        uses: softprops/action-gh-release@v0.1.14
        with:
          files: 'artifact/*'