Skip to content

Commit

Permalink
Add deploy github action
Browse files Browse the repository at this point in the history
  • Loading branch information
mkermani144 committed Apr 3, 2022
1 parent dd93107 commit 575c261
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Deploy

on: push

jobs:
deploy:
strategy:
matrix:
include:
- runs_on: ubuntu-latest
os: linux
target: x86_64-unknown-linux-gnu
file_name: akc
- runs_on: windows-latest
os: windows
target: x86_64-pc-windows-msvc
file_name: akc.exe
- runs_on: macos-latest
os: macos
target: x86_64-apple-darwin
file_name: akc

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

env:
ARTIFACT_NAME: akc-${{ github.ref_name }}-${{ matrix.os }}

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build
run: |
rustup target add ${{ matrix.target }}
cargo build --release --target ${{ matrix.target }} --locked
mkdir ${{ env.ARTIFACT_NAME }}
cp target/${{ matrix.target }}/release/${{ matrix.file_name }} ${{ env.ARTIFACT_NAME }}/
cp README.md ${{ env.ARTIFACT_NAME }}/
cp LICENSE ${{ env.ARTIFACT_NAME }}/
tar czvf ${{ env.ARTIFACT_NAME }}.tar.gz ${{ env.ARTIFACT_NAME }}
- name: Deploy
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: ${{ env.ARTIFACT_NAME }}.tar.gz

0 comments on commit 575c261

Please sign in to comment.