Skip to content

Commit

Permalink
feat: releaser github actiton
Browse files Browse the repository at this point in the history
  • Loading branch information
DarthBenro008 committed Jul 31, 2021
1 parent f7e0865 commit d291561
Showing 1 changed file with 72 additions and 0 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/Releaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Release

on:
push:
tags:
- "v*"

jobs:
build:
name: Build for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
env:
GOOGLE_CLIENT_ID: ${{ secrets.CLIENT }}
GOOGLE_CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
strategy:
fail-fast: false
matrix:
name: [linux, windows, macos]
include:
- name: linux
os: ubuntu-latest
artifact_path: target/release/rchore
asset_name: rchore-linux
- name: windows
os: windows-latest
artifact_path: target/release/rchore.exe
asset_name: rchore-windows.exe
- name: macos
os: macos-latest
artifact_path: target/release/rchore
asset_name: rchore-macos

steps:
- uses: actions/checkout@v1

- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable

- name: Build
run: cargo build --release --locked

- name: Rename binary
run: mv ${{ matrix.artifact_path }} ${{ matrix.asset_name }}

- name: Create NPM Release
run: mkdir -p builds/rchore-${{ matrix.name }} && cp ${{ matrix.asset_name }} builds/rchore-${{ matrix.name }} && tar -C builds -czvf rchore-${{ matrix.name }}.tar.gz rchore-${{ matrix.name }}

- name: Release binary
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
rchore-${{ matrix.name }}.tar.gz
${{ matrix.asset_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

changelog:
name: Update Changelog
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Release Changelog
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
body_path: CHANGELOG.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit d291561

Please sign in to comment.