name: Main on: [push] jobs: build: strategy: matrix: os: - macos-latest - ubuntu-latest - windows-latest include: - os: ubuntu-latest target: x86_64-unknown-linux-musl - os: macos-latest target: x86_64-apple-darwin - os: windows-latest target: x86_64-pc-windows-msvc runs-on: ${{matrix.os}} steps: - uses: actions/checkout@v1 - name: Install uses: actions-rs/toolchain@v1 with: toolchain: stable target: ${{matrix.target}} profile: minimal components: clippy, rustfmt override: true - name: Version run: | rustup --version cargo --version cargo clippy --version - name: Build run: cargo build --all --verbose - name: Test run: cargo test --all --verbose - name: Clippy run: cargo clippy --all - name: Lint if: matrix.os != 'windows-latest' run: ./bin/lint - name: Format run: cargo fmt --all -- --check - name: Readme if: matrix.os != 'windows-latest' run: | cargo run --package update-readme toc git diff --no-ext-diff --quiet --exit-code - name: Package id: package if: startsWith(github.ref, 'refs/tags/v') run: ./bin/package ${{github.ref}} ${{matrix.os}} ${{matrix.target}} shell: bash - name: Publish uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/v') with: draft: false files: ${{steps.package.outputs.archive}} prerelease: false env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}