Skip to content

Commit

Permalink
github: Add action
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
  • Loading branch information
patrickelectric committed Mar 19, 2024
1 parent b63e85a commit 1ee765c
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/deploy.yml
@@ -0,0 +1,65 @@
name: Deploy mavftp-cli

on: [push, pull_request]

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
TARGET: aarch64-apple-darwin

- os: macos-latest
TARGET: x86_64-apple-darwin

- os: ubuntu-latest
TARGET: arm-unknown-linux-musleabihf

- os: ubuntu-latest
TARGET: armv7-unknown-linux-musleabihf

- os: ubuntu-latest
TARGET: x86_64-unknown-linux-musl

- os: windows-latest
TARGET: x86_64-pc-windows-msvc
EXTENSION: .exe

steps:
- name: Building ${{ matrix.TARGET }}
run: echo "${{ matrix.TARGET }}"

- uses: actions/checkout@master
- uses: actions-rs/toolchain@v1.0.1
with:
toolchain: stable
target: ${{ matrix.TARGET }}
override: true

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

- name: Rename
run: cp target/${{ matrix.TARGET }}/release/mavftp-cli${{ matrix.EXTENSION }} mavftp-cli-${{ matrix.TARGET }}${{ matrix.EXTENSION }}

- uses: actions/upload-artifact@master
with:
name: mavftp-cli-${{ matrix.TARGET }}${{ matrix.EXTENSION }}
path: mavftp-cli-${{ matrix.TARGET }}${{ matrix.EXTENSION }}

- uses: svenstaro/upload-release-action@v2
name: Upload binaries to release
if: ${{ github.event_name == 'push' }}
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: mavftp-cli-${{ matrix.TARGET }}${{ matrix.EXTENSION }}
asset_name: mavftp-cli-${{ matrix.TARGET }}${{ matrix.EXTENSION }}
tag: ${{ github.ref }}
prerelease: ${{ !startsWith(github.ref, 'refs/tags/') }}
overwrite: true

0 comments on commit 1ee765c

Please sign in to comment.