Skip to content

Commit

Permalink
Add tag release GitHub action
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasfarias committed Mar 17, 2021
1 parent 11d9795 commit 60d891a
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/release_tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Build and release on tag creation

on:
push:
tags:
- 'v*.*.*'

jobs:
build:
name: Build and release
strategy:
matrix:
target: [
aarch64-unknown-linux-gnu,
armv7-unknown-linux-gnueabihf,
i686-unknown-linux-gnu,
i686-unknown-linux-musl,
mips-unknown-linux-gnu,
mips64-unknown-linux-gnuabi64,
mips64el-unknown-linux-gnuabi64,
mipsel-unknown-linux-gnu,
powerpc-unknown-linux-gnu,
powerpc64-unknown-linux-gnu,
powerpc64le-unknown-linux-gnu,
arm-unknown-linux-gnueabi,
x86_64-unknown-linux-gnu,
x86_64-unknown-linux-musl
]
runs-on: ubuntu-latest

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

- name: Install rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
target: ${{ matrix.target }}

- name: Build target
uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --release --bin c2g --target ${{ matrix.target }}

- name: Package
shell: bash
run: |
cd target/${{ matrix.target }}/release
tar czvf ../../../c2g-${{ matrix.target }}.tar.gz c2g
cd -
- name: Release
uses: softprops/action-gh-release@v1
with:
files: 'c2g*'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 60d891a

Please sign in to comment.