From 84a85576b7ae8a3c8dc9950558cc212e8ef67e29 Mon Sep 17 00:00:00 2001 From: MCOfficer Date: Wed, 1 Apr 2020 16:15:36 +0200 Subject: [PATCH] Add CD --- .github/workflows/cd.yml | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/cd.yml diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 0000000..e8183f7 --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,40 @@ +name: CD + +on: + push: + tags: + - "v*.*.*" + +env: + target: x86_64-unknown-linux-musl + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Install musl + run: sudo apt-get update && sudo apt-get install -y musl musl-tools + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + target: ${{ env.target }} + default: true + - name: Build + uses: actions-rs/cargo@v1 + with: + command: build + args: --release --target ${{ env.target }} + - name: Strip binary + run: strip ./target/${{ env.target }}/release/container-stats + - name: Move binary + run: mv target/${{ env.target }}/release/container-stats container-stats-${{ env.target }} + - name: Upload binary + uses: softprops/action-gh-release@v1 + with: + files: | + container-stats-${{ env.target }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}