mirror of
https://github.com/arabianq/build_msp.git
synced 2026-04-28 06:21:24 +00:00
add build workflow
fix incorrect workflows dir add workflow_dispatch to release build add deps installation to release.yml fix release.yml not cloning submodules try to fix auto builds on windows another attemp to fix automatic building on windows one more attemp to fix automatic building on windows change cargo/bin path on windows fix windows builds test
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
name: Release Build
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Install build dependencies (Linux)
|
||||
if: runner.os == 'Linux'
|
||||
run: sudo apt-get update && sudo apt-get install -y autoconf automake libtool
|
||||
|
||||
- name: Install build dependencies (macOS)
|
||||
if: runner.os == 'macOS'
|
||||
run: brew install autoconf automake libtool
|
||||
|
||||
- name: Install build dependencies (Windows)
|
||||
if: runner.os == 'Windows'
|
||||
uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
msystem: MINGW64
|
||||
update: true
|
||||
install: autoconf automake libtool make m4 perl autotools
|
||||
run: whereis aclocal
|
||||
|
||||
- name: Install Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
toolchain: stable
|
||||
|
||||
- name: Cache Cargo dependencies
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
target
|
||||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-cargo-
|
||||
|
||||
- name: Build (Linux/macOS)
|
||||
if: runner.os != 'Windows'
|
||||
run: cargo build --release
|
||||
|
||||
- name: Build (Windows)
|
||||
if: runner.os == 'Windows'
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
# ensure cargo is in PATH
|
||||
export PATH=/c/Users/runneradmin/.cargo/bin:$PATH
|
||||
# ensure mingw64 bin is in PATH
|
||||
export PATH=/mingw64/bin:/usr/bin:$PATH
|
||||
cargo build --release
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: build-${{ matrix.os }}
|
||||
path: target/release/build_msp*
|
||||
Reference in New Issue
Block a user