Skip to content

Commit

Permalink
github: action: Add build and deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
RaulTrombin committed Sep 5, 2024
1 parent 4a0042d commit 2773881
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,59 @@ jobs:

- name: Build
run: cargo build --verbose

build:
needs: quick-tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: macos-14
TARGET: aarch64-apple-darwin

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

- os: ubuntu-22.04
TARGET: aarch64-unknown-linux-musl

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

- os: ubuntu-22.04
TARGET: x86_64-unknown-linux-gnu

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

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

- uses: actions/checkout@master
- name: Build
uses: houseabsolute/[email protected]
with:
target: ${{ matrix.TARGET }}
args: "--release"

- name: Rename
run: cp target/${{ matrix.TARGET }}/release/${{ github.event.repository.name }}${{ matrix.EXTENSION }} ${{ github.event.repository.name }}-${{ matrix.TARGET }}${{ matrix.EXTENSION }}

- uses: actions/upload-artifact@master
with:
name: ${{ github.event.repository.name }}-${{ matrix.TARGET }}${{ matrix.EXTENSION }}
path: ${{ github.event.repository.name }}-${{ 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: ${{ github.event.repository.name }}-${{ matrix.TARGET }}${{ matrix.EXTENSION }}
asset_name: ${{ github.event.repository.name }}-${{ matrix.TARGET }}${{ matrix.EXTENSION }}
tag: ${{ github.ref }}
prerelease: ${{ !startsWith(github.ref, 'refs/tags/') }}
overwrite: true

0 comments on commit 2773881

Please sign in to comment.