Skip to content

Commit

Permalink
Add release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
high-moctane committed Feb 19, 2022
1 parent d9da30c commit 7171b22
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Release

on:
push:
tags:
- "*"

jobs:
build:
name: Release binary
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
artifact_name: mocword
asset_name: mocword-x86_64-unknown-linux-musl
- os: ubuntu-latest
target: x86_64-pc-windows-gnu
artifact_name: mocword.exe
asset_name: mocword-x86_64-pc-windows-gnu.exe
- os: macos-latest
target: x86_64-apple-darwin
artifact_name: mocword
asset_name: mocword-x86_64-apple-darwin

runs-on: ${{ matrix.os }}

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Cross build with all features
uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --release --target ${{ matrix.target }} --all-features --verbose

- 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

0 comments on commit 7171b22

Please sign in to comment.