sd/.github/workflows/publish.yml

76 lines
1.8 KiB
YAML
Raw Normal View History

2020-07-03 11:38:52 -04:00
name: Publish
on:
push:
tags:
- '*'
jobs:
publish:
2020-07-03 11:58:27 -04:00
name: ${{ matrix.target }}
2020-07-03 11:38:52 -04:00
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
2021-02-28 23:41:21 -05:00
use-cross: false
2020-07-03 11:38:52 -04:00
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
2021-02-28 23:41:21 -05:00
use-cross: false
- os: ubuntu-latest
target: arm-unknown-linux-gnueabihf
use-cross: true
2020-07-03 11:38:52 -04:00
- os: windows-latest
target: x86_64-pc-windows-msvc
2021-02-28 23:41:21 -05:00
use-cross: false
2020-07-03 11:38:52 -04:00
- os: macos-latest
target: x86_64-apple-darwin
2021-02-28 23:41:21 -05:00
use-cross: false
2020-07-03 11:38:52 -04:00
2021-03-04 23:36:44 -05:00
- os: macos-latest
target: aarch64-apple-darwin
use-cross: false
2020-07-03 11:38:52 -04:00
steps:
2020-07-03 11:40:54 -04:00
- 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 }}
2020-07-03 11:38:52 -04:00
- name: Build
2021-02-28 23:46:49 -05:00
uses: actions-rs/cargo@v1
2021-02-28 23:41:21 -05:00
with:
use-cross: ${{ matrix.use-cross }}
command: build
2021-02-28 23:46:49 -05:00
args: --target ${{ matrix.target }} --release --locked
2020-07-03 11:38:52 -04:00
- 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 }}