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
10 changes: 10 additions & 0 deletions .github/actions/build-native-binaries/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Build Native Binaries
description: Cross-compile all binaries.

runs:
using: "composite"
steps:
- name: Run bun build:all
shell: bash
working-directory: npm
run: bun build:all
19 changes: 19 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Setup
description: Install tools and dependencies

runs:
using: "composite"
steps:
- name: Install Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version-file: npm/package.json
- name: Install Dependencies
shell: bash
run: |
pushd npm
bun install --frozen-lockfile
popd
pushd demo
bun install --frozen-lockfile
popd
83 changes: 18 additions & 65 deletions .github/workflows/build-native-binaries.yml
Original file line number Diff line number Diff line change
@@ -1,74 +1,27 @@
name: Build Native Binaries
on:
workflow_call:
workflow_dispatch:

jobs:
build:
name: Build ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
# Windows x86_64
- target: x86_64-pc-windows-gnu
os: windows-latest
artifact_name: buildc-windows-x64.exe
# Windows arm64
- target: aarch64-pc-windows-msvc
os: windows-latest
artifact_name: buildc-windows-arm64.exe
# MacOS x86_64
- target: x86_64-apple-darwin
os: macos-latest
artifact_name: buildc-macos-x64
# MacOS arm64
- target: aarch64-apple-darwin
os: macos-latest
artifact_name: buildc-macos-arm64
# Linux x86_64
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
artifact_name: buildc-linux-x64
cross: true
# Linux arm64
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
artifact_name: buildc-linux-arm64
cross: true # ARM builds are failing at the linker step, but works when using cross!
name: Build
runs-on: ubuntu-latest
steps:
# Checkout and pull changes from previous jobs
- uses: actions/checkout@v4
- run: git pull
# Setup
- uses: dtolnay/rust-toolchain@stable
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- uses: ./.github/actions/setup

- working-directory: npm
run: bun build:all

- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # 7.0.0
with:
targets: ${{ matrix.target }}
- name: Install Cross
if: matrix.cross == true
run: cargo install cross
# Build
- name: Build (Native)
if: matrix.cross != true
run: cargo build --release --target ${{ matrix.target }}
- name: Build (Cross)
if: matrix.cross == true
run: cross build --release --target ${{ matrix.target }}
- name: Rename buildc (Windows)
if: runner.os == 'Windows'
run: |
mkdir dist
mv target/${{ matrix.target }}/release/aklinker1_buildc.exe dist/${{ matrix.artifact_name }}
shell: bash
- name: Rename buildc (Unix)
if: runner.os != 'Windows'
run: |
mkdir dist
mv target/${{ matrix.target }}/release/aklinker1_buildc dist/${{ matrix.artifact_name }}
# Signing: TODO
# Upload
- name: Upload artifact
uses: actions/upload-artifact@v4
name: binaries
path: npm/dist/artifacts/*
if-no-files-found: error

- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # 7.0.0
with:
name: ${{ matrix.artifact_name }}
path: dist/${{ matrix.artifact_name }}
name: packages
path: npm/dist/@aklinker1
if-no-files-found: error
7 changes: 0 additions & 7 deletions .github/workflows/release.yml

This file was deleted.

43 changes: 43 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Validate
on:
pull_request:
workflow_call:
workflow_dispatch:
push:
branches:
- main

jobs:
checks:
name: Checks
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- uses: ./.github/actions/setup

- working-directory: npm
run: bun check

build:
name: Build
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- uses: ./.github/actions/setup

- run: cargo build

- name: Validate binary
working-directory: demo
run: |
bun buildc --help
bun buildc graph
bun buildc all
bun buildc clean
pushd packages/b
bun buildc -- -- echo "done"
bun buildc clean
bun buildc deps && echo "done"
popd
13 changes: 12 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
# Cargo
#
/target
.cache
.intentionally-empty-file.o

# NPM
#
**/dist
**/node_modules
.cache

# Misc.
#
.DS_Store
*.log
Loading