1
0
mirror of https://github.com/danog/ytop.git synced 2024-12-04 02:17:53 +01:00
ytop/.github/workflows/publish-binaries.yml
2019-10-29 12:27:07 -07:00

53 lines
1.3 KiB
YAML

name: Publish Binaries
on: release
env:
NAME: rtop
jobs:
publish:
env:
FILE: ${{ NAME }}-${{ GITHUB_REF }}-${{ matrix.target }}.tar.gz
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macOS-latest
target:
- x86_64-unknown-linux-gnu
- x86_64-apple-darwin
exclude:
- os: macOS-latest
target: x86_64-unknown-linux-gnu
- os: ubuntu-latest
target: x86_64-apple-darwin
steps:
- name: Checkout sources
uses: actions/checkout@v1
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
override: true
- name: Build release binary
uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --release --target=${{ matrix.target }}
- name: Archive and compress binary
run: tar -czf ${{ FILE }} -C ./target/${{ matrix.target }}/release/ ${{ NAME }}
- name: Upload archive to GitHub releases
uses: JasonEtco/upload-to-release@master
with:
args: ${{ FILE }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}