Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 88 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Release

on:
push:
tags:
- 'v*'
workflow_dispatch:

permissions:
contents: write

jobs:
build:
name: Build backend release binaries
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-apple-darwin
os: macos-latest
- target: aarch64-apple-darwin
os: macos-latest
- target: x86_64-pc-windows-msvc
os: windows-latest

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4

- name: Install cross-compilation tools
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get install -y gcc-aarch64-linux-gnu libc6-dev-arm64-cross

- name: Install minimal nightly
uses: dtolnay/rust-toolchain@nightly
with:
targets: ${{ matrix.target }}

- name: Build
run: cargo build --release --target ${{ matrix.target }} -p forge-bin
env:
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc

- name: Compress and package binaries
shell: bash
run: |
mkdir -p artifacts
if [ "${{ matrix.os }}" = "windows-latest" ]; then
cp target/${{ matrix.target }}/release/forgedb.exe artifacts/forgedb-${{ matrix.target }}.exe
else
cp target/${{ matrix.target }}/release/forgedb artifacts/forgedb-${{ matrix.target }}
chmod +x artifacts/forgedb-${{ matrix.target }}
tar -czvf artifacts/forgedb-${{ matrix.target }}.tar.gz -C artifacts forgedb-${{ matrix.target }}
rm artifacts/forgedb-${{ matrix.target }}
fi

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: forge-binaries-${{ matrix.target }}
path: artifacts/*

release:
name: Create GitHub Release
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Download artifacts
uses: actions/download-artifact@v4
with:
pattern: forge-binaries-*
merge-multiple: true
path: release-assets

- name: Create Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: release-assets/*
draft: false
prerelease: false
generate_release_notes: true
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

# ForgeDB runtime data — never commit certs, keys, or encrypted DBs
forgedb_data/
forgedb.toml
*.redbx
*.log

# OS noise
.DS_Store
Expand Down
Loading
Loading