Add build release workflow

This commit is contained in:
ethanaobrien 2024-12-08 17:25:49 -06:00
parent 1e32cb8688
commit de31838195

View file

@ -0,0 +1,56 @@
name: Build release binaries
on:
push:
tags: 'v*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checking out branch
uses: actions/checkout@v3
- name: Install Rust
shell: bash
run: curl -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path --default-toolchain stable --profile minimal
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Create out directory
run: |
mkdir out
- name: Build webui
run: |
cd webui
npm install
npm run build
- name: Build x86_64-unknown-linux-gnu
run: |
. "$HOME/.cargo/env"
cargo build --target x86_64-unknown-linux-gnu --release || echo "Failed to build"
mv target/x86_64-unknown-linux-gnu/release/ew out/ew-x86_64-unknown-linux-gnu
- name: Build x86_64-pc-windows-gnu
run: |
. "$HOME/.cargo/env"
sudo apt update && sudo apt install gcc-mingw-w64 -y
rustup target add x86_64-pc-windows-gnu
cargo build --target x86_64-pc-windows-gnu --release || echo "Failed to build"
mv target/x86_64-pc-windows-gnu/release/ew.exe out/ew-x86_64-pc-windows-gnu.exe
- name: Publish release
uses: actions/forgejo-release@v2
with:
direction: upload
release-dir: ./out/
release-notes-assistant: true
tag: "${{ github.ref_name }}"
sha: "${{ github.sha }}"
title: "Release ${{ github.ref_name }}"
token: ${{ github.token }}