Skip to content

Build and Publish BuildIt Release #1

Build and Publish BuildIt Release

Build and Publish BuildIt Release #1

name: Build and Publish BuildIt Release
on:
workflow_dispatch: # hope this works :)
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
rust: [stable]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Rust
uses: actions/setup-rust@v1
with:
rust-version: stable
- name: Install cargo-bundle
run: cargo install cargo-bundle
- name: Build for ${{ matrix.os }}
run: |
if [ "${{ matrix.os }}" == "windows-latest" ]; then
cargo build --release --target x86_64-pc-windows-msvc
elif [ "${{ matrix.os }}" == "macos-latest" ]; then
cargo build --release --target x86_64-apple-darwin
else
cargo build --release --target x86_64-unknown-linux-gnu
fi
- name: Archive release binaries
run: |
if [ "${{ matrix.os }}" == "windows-latest" ]; then
mkdir release && mv target/x86_64-pc-windows-msvc/release/* release/
elif [ "${{ matrix.os }}" == "macos-latest" ]; then
mkdir release && mv target/x86_64-apple-darwin/release/* release/
else
mkdir release && mv target/x86_64-unknown-linux-gnu/release/* release/
fi
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: release/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release Description
run: |
curl -X PATCH -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-d '{"body": "v1.0!!"}' \
"https://api.github.com/repos/${{ github.repository }}/releases/latest"