Skip to content
Draft
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
15 changes: 15 additions & 0 deletions bare-base/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ inputs:
description: Optional scope for scoped registries (e.g. @myorg)
node-auth-token:
description: npm auth token
source:
description: Compile Bare from source instead of installing the prebuilt runtime
default: false
ref:
description: The `holepunchto/bare` git ref (branch, tag, or SHA) to compile when building from source
flags:
description: Additional flags to pass to the build system when compiling from source
path:
description: The directory to check out and build the Bare source in when compiling from source
default: .bare

runs:
using: composite
Expand All @@ -27,3 +37,8 @@ runs:
scope: ${{ inputs.scope }}
node-auth-token: ${{ inputs.node-auth-token }}
- uses: holepunchto/actions/setup-bare@v1
with:
source: ${{ inputs.source }}
ref: ${{ inputs.ref }}
flags: ${{ inputs.flags }}
path: ${{ inputs.path }}
39 changes: 39 additions & 0 deletions compile-bare/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Compile Bare
description: Check out and compile Bare from source, installing it onto PATH

inputs:
ref:
description: The `holepunchto/bare` git ref (branch, tag, or SHA) to compile
flags:
description: Additional flags to pass to the build system (e.g. `--sanitize address`)
path:
description: The directory to check out and build the Bare source in
default: .bare

runs:
using: composite
steps:
- uses: holepunchto/actions/setup-llvm@v1
- uses: holepunchto/actions/setup-nasm@v1
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: holepunchto/bare
ref: ${{ inputs.ref }}
path: ${{ inputs.path }}
persist-credentials: false
- run: npm install --ignore-scripts
working-directory: ${{ inputs.path }}
shell: bash
- id: prefix
run: echo "path=$(npm prefix --global)" >> "$GITHUB_OUTPUT"
shell: bash
- uses: holepunchto/actions/compile-prebuilds@v1
with:
flags: ${{ inputs.flags }}
path: ${{ inputs.path }}
prefix: ${{ steps.prefix.outputs.path }}
- run: cp "$PREFIX/bin/bare.exe" "$PREFIX/"
if: ${{ runner.os == 'Windows' }}
env:
PREFIX: ${{ steps.prefix.outputs.path }}
shell: bash
12 changes: 8 additions & 4 deletions compile-prebuilds/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@ description: Compile and optionally upload native prebuilds
inputs:
platform:
description: The platform to compile for
required: true
arch:
description: The architecture to compile for
required: true
flags:
description: Additional flags to apply to the build system
tags:
description: Additional tags to apply to uploaded prebuilds
prefix:
description: The prebuild prefix
default: prebuilds
path:
description: The directory containing the source tree to compile
default: .
upload:
description: Upload the compiled prebuilds
default: false
Expand All @@ -24,22 +25,25 @@ runs:
steps:
- run: npm install --global bare-make
shell: bash
- run: bare-make generate --platform $PLATFORM --arch $ARCH $FLAGS
- run: bare-make generate ${PLATFORM:+--platform $PLATFORM} ${ARCH:+--arch $ARCH} $FLAGS
env:
PLATFORM: ${{ inputs.platform }}
ARCH: ${{ inputs.arch }}
FLAGS: ${{ inputs.flags }}
working-directory: ${{ inputs.path }}
shell: bash
- run: bare-make build
working-directory: ${{ inputs.path }}
shell: bash
- run: bare-make install --prefix $PREFIX
env:
PREFIX: ${{ inputs.prefix }}
working-directory: ${{ inputs.path }}
shell: bash
- uses: holepunchto/actions/upload-prebuilds@v1
if: ${{ inputs.upload == 'true' }}
with:
platform: ${{ inputs.platform }}
arch: ${{ inputs.arch }}
tags: ${{ inputs.tags }}
prefix: ${{ inputs.prefix }}
prefix: ${{ format('{0}/{1}', inputs.path, inputs.prefix) }}
21 changes: 20 additions & 1 deletion setup-bare/action.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
name: Setup Bare
description: Install and configure Bare
description: Install and configure Bare, optionally compiling a build from source

inputs:
source:
description: Compile Bare from source instead of installing the prebuilt runtime
default: false
ref:
description: The `holepunchto/bare` git ref (branch, tag, or SHA) to compile when building from source
flags:
description: Additional flags to pass to the build system when compiling from source
path:
description: The directory to check out and build the Bare source in when compiling from source
default: .bare

runs:
using: composite
steps:
- run: npm install --global bare-runtime
if: ${{ inputs.source != 'true' }}
shell: bash
- uses: holepunchto/actions/compile-bare@v1
if: ${{ inputs.source == 'true' }}
with:
ref: ${{ inputs.ref }}
flags: ${{ inputs.flags }}
path: ${{ inputs.path }}