diff options
author | Gregory <gregory.mkv@gmail.com> | 2020-07-03 11:38:52 -0400 |
---|---|---|
committer | Gregory <gregory.mkv@gmail.com> | 2020-07-03 11:38:52 -0400 |
commit | 866f188a32b17b7049ff2385deb2c00873dc823c (patch) | |
tree | 3578c79eeed206ebdbf9943be352a652f7943b34 | |
parent | 9e63e5d4bce427f20f76a13c1c71e159fd941b32 (diff) |
test new ci
-rw-r--r-- | .github/workflows/publish.yml | 59 | ||||
-rw-r--r-- | .github/workflows/test.yml | 40 |
2 files changed, 99 insertions, 0 deletions
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..2a842ab --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,59 @@ +name: Publish + +on: + push: + tags: + - '*' + +jobs: + publish: + name: Publish for ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - os: ubuntu-latest + target: x86_64-unknown-linux-gnu + + - os: ubuntu-latest + target: x86_64-unknown-linux-musl + + - os: windows-latest + target: x86_64-pc-windows-msvc + + - os: macos-latest + target: x86_64-apple-darwin + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + fetch-depth: 1 + + - name: Set the version + id: version + run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/} + + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + override: true + target: ${{ matrix.target }} + + + - name: Build + run: cargo build --release --locked + + - name: Strip binary + if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' + run: strip target/release/sd + + - name: Upload binaries to release + uses: svenstaro/upload-release-action@v1-release + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: target/release/sd + asset_name: sd-${{ steps.version.outputs.VERSION }}-${{ matrix.target }} + tag: ${{ github.ref }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..04b57ef --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,40 @@ +name: Test + +on: [pull_request] + +jobs: + publish: + name: Publish for ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - os: ubuntu-latest + target: x86_64-unknown-linux-gnu + + - os: ubuntu-latest + target: x86_64-unknown-linux-musl + + - os: windows-latest + target: x86_64-pc-windows-msvc + + - os: macos-latest + target: x86_64-apple-darwin + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + fetch-depth: 1 + + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + override: true + target: ${{ matrix.target }} + + + - name: Test + run: cargo test |