Skip to content

CLI Early Access

CLI Early Access #2

#
# SPDX-License-Identifier: Apache-2.0
#
# Copyright The original authors
#
# Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
#
name: CLI Early Access
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 'Check out repository'
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 — https://github.com/actions/checkout/releases/tag/v6
with:
submodules: 'true'
- name: 'Set up Java'
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5 — https://github.com/actions/setup-java/releases/tag/v5
with:
java-version: '25'
distribution: 'temurin'
cache: 'maven'
- name: 'Build and install modules'
run: ./mvnw -ntp -B clean install
- name: 'Upload built artifacts'
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7 — https://github.com/actions/upload-artifact/releases/tag/v7
with:
name: maven-repo
path: ~/.m2/repository/dev/hardwood/
retention-days: 1
package:
needs: build
name: 'Build native CLI on ${{ matrix.os }}'
strategy:
fail-fast: true
matrix:
os: [ ubuntu-latest, ubuntu-24.04-arm, macos-26-intel, macos-26, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: 'Check out repository'
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 — https://github.com/actions/checkout/releases/tag/v6
with:
submodules: 'true'
- name: 'Add Developer Command Prompt for Microsoft Visual C++'
if: ${{ runner.os == 'Windows' }}
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1 — https://github.com/ilammy/msvc-dev-cmd/releases/tag/v1
- name: 'Set up Graal'
uses: graalvm/setup-graalvm@03e8abf916fd0e281b2efe7b2da3378bb0a1d085 # v1 — https://github.com/graalvm/setup-graalvm/releases/tag/v1
with:
java-version: '25'
distribution: 'graalvm-community'
github-token: ${{ secrets.GITHUB_TOKEN }}
cache: maven
- name: 'Download built artifacts'
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 — https://github.com/actions/download-artifact/releases/tag/v8
with:
name: maven-repo
path: ~/.m2/repository/dev/hardwood/
- name: 'Build Native Image'
run: ./mvnw -ntp -B -Dnative package -pl cli -DskipTests
- name: 'Upload build artifact (tar.gz)'
if: ${{ runner.os != 'Windows' }}
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7 — https://github.com/actions/upload-artifact/releases/tag/v7
with:
name: artifacts-${{ runner.os }}-${{ runner.arch }}
path: cli/target/*.tar.gz
- name: 'Upload build artifact (zip)'
if: ${{ runner.os == 'Windows' }}
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7 — https://github.com/actions/upload-artifact/releases/tag/v7
with:
name: artifacts-${{ runner.os }}-${{ runner.arch }}
path: cli/target/*.zip
publish:
needs: package
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: 'Check out repository'
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 — https://github.com/actions/checkout/releases/tag/v6
with:
fetch-depth: 0
- name: 'Download all build artifacts'
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 — https://github.com/actions/download-artifact/releases/tag/v8
with:
path: artifacts
pattern: artifacts-*
merge-multiple: true
- name: 'List artifacts'
run: ls -la artifacts/
- name: 'Create or update early-access release'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release delete 1.0-early-access --yes || true
git tag -f 1.0-early-access
git push -f origin 1.0-early-access
gh release create 1.0-early-access \
--title "1.0-early-access (CLI)" \
--notes "Early-access build of the \`hardwood\` CLI, updated on every push to \`main\`.
> **Warning**: This is a pre-release build and may be unstable.
**Platforms:**
- Linux x86_64
- Linux aarch64
- macOS x86_64 (Intel)
- macOS aarch64 (Apple Silicon)
- Windows x86_64" \
--prerelease \
artifacts/*