add gh-actions
parent
a66448e300
commit
6873560c89
@ -0,0 +1,66 @@
|
||||
name: release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: release binary
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- os: macos-latest
|
||||
artifact_prefix: macos
|
||||
target: x86_64-apple-darwin
|
||||
artifact_name: atr
|
||||
asset_name: atr-x86_64-apple-darwin
|
||||
- os: ubuntu-latest
|
||||
artifact_prefix: linux
|
||||
target: x86_64-unknown-linux-gnu
|
||||
artifact_name: atr
|
||||
asset_name: atr-x86_64-unknown-linux-gnu
|
||||
- os: windows-latest
|
||||
artifact_prefix: windows
|
||||
target: x86_64-pc-windows-msvc
|
||||
artifact_name: atr.exe
|
||||
asset_name: atr-x86_64-pc-windows-msvc
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: installing rust toolchain
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
override: true
|
||||
components: rustfmt, clippy
|
||||
|
||||
- name: installing needed macos dependencies
|
||||
if: matrix.os == 'macos-latest'
|
||||
run: brew install openssl@1.1
|
||||
- name: installing needed ubuntu dependencies
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y -qq pkg-config libssl-dev libxcb1-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev
|
||||
sudo apt-get install -y -qq mingw-w64
|
||||
- name: running cargo build
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: build
|
||||
toolchain: ${{ matrix.rust }}
|
||||
args: --release --target ${{ matrix.target }}
|
||||
|
||||
- name: upload binaries to release
|
||||
uses: svenstaro/upload-release-action@2.1.1
|
||||
with:
|
||||
repo_token: ${{ secrets.github_token }}
|
||||
file: target/${{ matrix.target }}/release/${{ matrix.artifact_name }}
|
||||
asset_name: ${{ matrix.asset_name }}
|
||||
tag: ${{ github.ref }}
|
||||
overwrite: true
|
||||
|
Loading…
Reference in New Issue