Skip to content

Commit

Permalink
build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
MXWXZ committed Aug 30, 2024
1 parent 4007be3 commit 36c9b7c
Showing 1 changed file with 88 additions and 0 deletions.
88 changes: 88 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Build

on:
workflow_dispatch:
pull_request:
branches:
- main
push:
tags-ignore:
- "plugin-v*"
- "v*"

jobs:
build_frontend:
name: Build frontend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "yarn"
cache-dependency-path: skynet/frontend/yarn.lock
- run: yarn
working-directory: skynet/frontend
- run: yarn build
working-directory: skynet/frontend

build_skynet:
needs: build_frontend
name: Build skynet ${{ matrix.platform.os_name }}
runs-on: ${{ matrix.platform.os }}
strategy:
matrix:
platform:
- os_name: linux-x86_64
os: ubuntu-latest
target: x86_64-unknown-linux-gnu
bin: skynet
name: skynet-linux-x86_64.tar.gz
- os_name: linux-i686
os: ubuntu-latest
target: i686-unknown-linux-gnu
bin: skynet
name: skynet-linux-i686.tar.gz
- os_name: linux-aarch64
os: ubuntu-latest
target: aarch64-unknown-linux-gnu
bin: skynet
name: skynet-linux-aarch64.tar.gz
- os_name: windows-x86_64
os: windows-latest
target: x86_64-pc-windows-gnu
bin: skynet.exe
name: skynet-windows-x86_64.zip
- os_name: macOS-x86_64
os: macOS-latest
target: x86_64-apple-darwin
bin: skynet
name: skynet-darwin-x86_64.tar.gz
- os_name: macOS-aarch64
os: macOS-latest
target: aarch64-apple-darwin
bin: skynet
name: skynet-darwin-aarch64.tar.gz
steps:
- uses: actions/checkout@v4
- name: Cache cargo & target directories
uses: Swatinem/rust-cache@v2
- uses: ilammy/setup-nasm@v1
if: ${{ matrix.platform.os == 'windows-latest'}}
- name: Install Protoc
id: protoc-install
uses: arduino/setup-protoc@v3
with:
version: "27.3"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Set protoc path
shell: bash
run: |
echo "${{ steps.protoc-install.outputs.path }}" >> $GITHUB_PATH
- name: Build binary
uses: houseabsolute/actions-rust-cross@v0
with:
command: "both"
target: ${{ matrix.platform.target }}
args: "--locked --release"
strip: false

0 comments on commit 36c9b7c

Please sign in to comment.