From acf991b347b3c17b6399773b23ad23001917f236 Mon Sep 17 00:00:00 2001 From: Rami3L Date: Thu, 28 May 2020 20:26:57 +0800 Subject: [PATCH] chore: update publish.yml, take 4 --- .github/workflows/macos-test.yml | 20 --------- .github/workflows/publish.yml | 44 +++++++++---------- .../workflows/{linux-test.yml => test.yml} | 30 +++++++++++-- .github/workflows/windows-test.yml | 20 --------- 4 files changed, 47 insertions(+), 67 deletions(-) delete mode 100644 .github/workflows/macos-test.yml rename .github/workflows/{linux-test.yml => test.yml} (67%) delete mode 100644 .github/workflows/windows-test.yml diff --git a/.github/workflows/macos-test.yml b/.github/workflows/macos-test.yml deleted file mode 100644 index e9fc4b352e7..00000000000 --- a/.github/workflows/macos-test.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: macos-test - -on: - push: - branches: [master, rs-dev] - pull_request: - branches: [master, rs-dev] - -jobs: - build: - runs-on: macOS-latest - - steps: - - uses: actions/checkout@v2 - - name: Build - run: cargo build --verbose - - name: Run tests - run: cargo test --verbose - - name: Run heavy tests - run: cargo test --verbose -- --ignored diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index d34496c691e..5211e43f64d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -6,36 +6,32 @@ on: - "*" jobs: - build: - name: Publish binaries - runs-on: ubuntu-latest - container: - image: docker://debian:testing + publish: + name: Publish for ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - os: ubuntu-latest + artifact_name: pacaptr + asset_name: pacaptr-linux-amd64 + - os: windows-latest + artifact_name: pacaptr.exe + asset_name: pacaptr-windows-amd64 + - os: macos-latest + artifact_name: pacaptr + asset_name: pacaptr-macos-amd64 steps: - - name: Setup Common Build Tools - run: apt-get update && apt-get install -y curl build-essential - - - name: Rust Environment Setup - uses: dtolnay/rust-toolchain@stable - - - name: Cross Environment Setup - run: cargo install cross - - - name: Checkout - uses: actions/checkout@v1 - + - uses: dtolnay/rust-toolchain@stable + - uses: actions/checkout@v1 - name: Build - run: cross build --release --target x86_64-apple-darwin --target-dir "./binaries/x86_64-apple-darwin/" - - - name: Zip - run: tar czvf "pacaptr-x86_64-apple-darwin.tar.gz" -C "./binaries/x86_64-apple-darwin/" . - + run: cargo build --release --locked - name: Upload binaries to release uses: svenstaro/upload-release-action@v1-release with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: pacaptr-x86_64-apple-darwin.tar.gz - asset_name: pacaptr-x86_64-apple-darwin.tar.gz + file: target/release/${{ matrix.artifact_name }} + asset_name: ${{ matrix.asset_name }} tag: ${{ github.ref }} overwrite: true diff --git a/.github/workflows/linux-test.yml b/.github/workflows/test.yml similarity index 67% rename from .github/workflows/linux-test.yml rename to .github/workflows/test.yml index 7aec7ae115d..6c99b6fcffc 100644 --- a/.github/workflows/linux-test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: linux-test +name: test on: push: @@ -7,7 +7,31 @@ on: branches: [master, rs-dev] jobs: - debian-build: + windows-test: + runs-on: windows-latest + + steps: + - uses: actions/checkout@v2 + - name: Build + run: cargo build --verbose + - name: Run tests + run: cargo test --verbose + - name: Run heavy tests + run: cargo test --verbose -- --ignored + + macos-test: + runs-on: macos-latest + + steps: + - uses: actions/checkout@v2 + - name: Build + run: cargo build --verbose + - name: Run tests + run: cargo test --verbose + - name: Run heavy tests + run: cargo test --verbose -- --ignored + + debian-test: runs-on: ubuntu-latest container: image: docker://debian:testing @@ -25,7 +49,7 @@ jobs: - name: Run heavy tests run: cargo test dpkg --verbose -- --ignored - alpine-build: + alpine-test: runs-on: ubuntu-latest container: image: docker://rust:alpine diff --git a/.github/workflows/windows-test.yml b/.github/workflows/windows-test.yml deleted file mode 100644 index 1ed6115f205..00000000000 --- a/.github/workflows/windows-test.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: windows-test - -on: - push: - branches: [master, rs-dev] - pull_request: - branches: [master, rs-dev] - -jobs: - build: - runs-on: windows-latest - - steps: - - uses: actions/checkout@v2 - - name: Build - run: cargo build --verbose - - name: Run tests - run: cargo test --verbose - - name: Run heavy tests - run: cargo test --verbose -- --ignored