From cf59a58c67331fef371011d562abb9f1f1bf6437 Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Tue, 28 Jan 2020 02:59:45 -0800 Subject: [PATCH] Build and upload release artifacts from CI type: distribution --- .github/workflows/{rust.yaml => main.yaml} | 28 +++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) rename .github/workflows/{rust.yaml => main.yaml} (57%) diff --git a/.github/workflows/rust.yaml b/.github/workflows/main.yaml similarity index 57% rename from .github/workflows/rust.yaml rename to .github/workflows/main.yaml index 8006f6f..514bec4 100644 --- a/.github/workflows/rust.yaml +++ b/.github/workflows/main.yaml @@ -1,4 +1,4 @@ -name: Rust +name: Main on: [push] @@ -10,6 +10,13 @@ jobs: - 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 @@ -17,6 +24,7 @@ jobs: uses: actions-rs/toolchain@v1 with: toolchain: stable + target: ${{matrix.target}} profile: minimal components: clippy, rustfmt override: true @@ -31,13 +39,27 @@ jobs: run: cargo test --all --verbose - name: Clippy run: cargo clippy --all - - name: Format - run: cargo fmt --all -- --check - name: Lint if: matrix.os != 'windows-latest' run: "! grep --color -REn 'FIXME|TODO|XXX' src" + - 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}}