name: Release
on:
push:
tags:
- 'v*'
jobs:
release:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
name: linux
artifact: rusync-linux
- os: macos-latest
name: osx
artifact: rusync-osx
- os: windows-latest
name: windows
artifact: rusync-windows.exe
steps:
- name: Checkout code
uses: actions/checkout@v1
- name: Install latest stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --release
- name: Rename artifacts - Linux, macOS
if: matrix.name != 'windows'
run: mv target/release/rusync ${{ matrix.artifact }}
- name: Rename artifacts - Windows
if: matrix.name == 'windows'
run: |
Move-Item -Path target\release\rusync.exe -Destination ${{ matrix.artifact }}
shell: powershell
- name: Upload assets
uses: softprops/action-gh-release@v1
with:
files: rusync-*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}