mirror of
https://github.com/floci-io/floci-cli.git
synced 2026-11-23 06:00:47 -05:00
chore: first commit
This commit is contained in:
69 files changed
+3697
No files matched your search
@@ -0,0 +1,171 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths:
|
||||
- 'src/**'
|
||||
- 'pom.xml'
|
||||
- '.github/workflows/ci.yml'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'src/**'
|
||||
- 'pom.xml'
|
||||
- '.github/workflows/ci.yml'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Build and Test (JVM)
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: '25'
|
||||
distribution: 'temurin'
|
||||
cache: maven
|
||||
|
||||
- name: Run unit tests
|
||||
run: mvn test -B
|
||||
|
||||
native-linux-amd64:
|
||||
name: Native image — linux/amd64
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 45
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: graalvm/setup-graalvm@v1
|
||||
with:
|
||||
java-version: '24'
|
||||
distribution: 'graalvm-community'
|
||||
cache: maven
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build native binary
|
||||
run: mvn clean package -Pnative -DskipTests -B
|
||||
|
||||
- name: Smoke test — version
|
||||
run: ./target/floci version
|
||||
|
||||
- name: Smoke test — doctor
|
||||
run: ./target/floci doctor || true # non-zero is ok in CI (docker may not be running)
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: floci-linux-amd64
|
||||
path: target/floci
|
||||
retention-days: 7
|
||||
|
||||
native-linux-arm64:
|
||||
name: Native image — linux/arm64
|
||||
runs-on: ubuntu-24.04-arm
|
||||
timeout-minutes: 45
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: graalvm/setup-graalvm@v1
|
||||
with:
|
||||
java-version: '24'
|
||||
distribution: 'graalvm-community'
|
||||
cache: maven
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build native binary
|
||||
run: mvn clean package -Pnative -DskipTests -B
|
||||
|
||||
- name: Smoke test — version
|
||||
run: ./target/floci version
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: floci-linux-arm64
|
||||
path: target/floci
|
||||
retention-days: 7
|
||||
|
||||
native-macos-amd64:
|
||||
name: Native image — macos/amd64
|
||||
runs-on: macos-13
|
||||
timeout-minutes: 45
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: graalvm/setup-graalvm@v1
|
||||
with:
|
||||
java-version: '24'
|
||||
distribution: 'graalvm-community'
|
||||
cache: maven
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build native binary
|
||||
run: mvn clean package -Pnative -DskipTests -B
|
||||
|
||||
- name: Smoke test — version
|
||||
run: ./target/floci version
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: floci-darwin-amd64
|
||||
path: target/floci
|
||||
retention-days: 7
|
||||
|
||||
native-macos-arm64:
|
||||
name: Native image — macos/arm64
|
||||
runs-on: macos-latest
|
||||
timeout-minutes: 45
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: graalvm/setup-graalvm@v1
|
||||
with:
|
||||
java-version: '24'
|
||||
distribution: 'graalvm-community'
|
||||
cache: maven
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build native binary
|
||||
run: mvn clean package -Pnative -DskipTests -B
|
||||
|
||||
- name: Smoke test — version
|
||||
run: ./target/floci version
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: floci-darwin-arm64
|
||||
path: target/floci
|
||||
retention-days: 7
|
||||
|
||||
native-windows-amd64:
|
||||
name: Native image — windows/amd64
|
||||
runs-on: windows-latest
|
||||
timeout-minutes: 60
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: graalvm/setup-graalvm@v1
|
||||
with:
|
||||
java-version: '24'
|
||||
distribution: 'graalvm-community'
|
||||
cache: maven
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build native binary
|
||||
run: mvn clean package -Pnative -DskipTests -B
|
||||
|
||||
- name: Smoke test — version
|
||||
run: target\floci.exe version
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: floci-windows-amd64
|
||||
path: target/floci.exe
|
||||
retention-days: 7
|
||||
@@ -0,0 +1,69 @@
|
||||
name: Homebrew Bump
|
||||
|
||||
# Triggered after release.yml succeeds on a version tag.
|
||||
# Opens a PR in floci-io/homebrew-floci with the new version and SHA256.
|
||||
#
|
||||
# Required secrets: HOMEBREW_BUMP_TOKEN (PAT with repo scope on homebrew-floci repo)
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: [Release]
|
||||
types: [completed]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
bump:
|
||||
name: Bump Homebrew formula
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- name: Extract version from tag
|
||||
id: version
|
||||
run: |
|
||||
TAG="${{ github.event.workflow_run.head_branch }}"
|
||||
echo "version=${TAG}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Download release checksums
|
||||
run: |
|
||||
VERSION="${{ steps.version.outputs.version }}"
|
||||
curl -fsSL "https://github.com/floci-io/floci-cli/releases/download/${VERSION}/sha256sums.txt" \
|
||||
-o sha256sums.txt
|
||||
cat sha256sums.txt
|
||||
|
||||
- name: Extract per-platform SHA256
|
||||
id: sha
|
||||
run: |
|
||||
echo "darwin_amd64=$(grep 'floci-darwin-amd64' sha256sums.txt | awk '{print $1}')" >> "$GITHUB_OUTPUT"
|
||||
echo "darwin_arm64=$(grep 'floci-darwin-arm64' sha256sums.txt | awk '{print $1}')" >> "$GITHUB_OUTPUT"
|
||||
echo "linux_amd64=$(grep 'floci-linux-amd64' sha256sums.txt | awk '{print $1}')" >> "$GITHUB_OUTPUT"
|
||||
echo "linux_arm64=$(grep 'floci-linux-arm64' sha256sums.txt | awk '{print $1}')" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Checkout homebrew tap
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: floci-io/homebrew-floci
|
||||
token: ${{ secrets.HOMEBREW_BUMP_TOKEN }}
|
||||
path: homebrew-floci
|
||||
|
||||
- name: Update formula
|
||||
run: |
|
||||
VERSION="${{ steps.version.outputs.version }}"
|
||||
FORMULA="homebrew-floci/Formula/floci.rb"
|
||||
sed -i "s/version \".*\"/version \"${VERSION}\"/" "$FORMULA"
|
||||
sed -i "/darwin-amd64/ { n; s/sha256 \".*\"/sha256 \"${{ steps.sha.outputs.darwin_amd64 }}\"/ }" "$FORMULA"
|
||||
sed -i "/darwin-arm64/ { n; s/sha256 \".*\"/sha256 \"${{ steps.sha.outputs.darwin_arm64 }}\"/ }" "$FORMULA"
|
||||
sed -i "/linux-amd64/ { n; s/sha256 \".*\"/sha256 \"${{ steps.sha.outputs.linux_amd64 }}\"/ }" "$FORMULA"
|
||||
sed -i "/linux-arm64/ { n; s/sha256 \".*\"/sha256 \"${{ steps.sha.outputs.linux_arm64 }}\"/ }" "$FORMULA"
|
||||
|
||||
- name: Open PR
|
||||
uses: peter-evans/create-pull-request@v7
|
||||
with:
|
||||
token: ${{ secrets.HOMEBREW_BUMP_TOKEN }}
|
||||
path: homebrew-floci
|
||||
commit-message: "floci ${{ steps.version.outputs.version }}"
|
||||
title: "floci ${{ steps.version.outputs.version }}"
|
||||
body: "Automated bump from floci-cli release workflow."
|
||||
branch: "bump-${{ steps.version.outputs.version }}"
|
||||
@@ -0,0 +1,231 @@
|
||||
name: Release
|
||||
|
||||
# Triggered when a SemVer tag (e.g. 0.1.0) is pushed.
|
||||
# Builds native binaries for all 5 platform targets, creates a GitHub Release,
|
||||
# and pushes Docker image floci/cli:<version>.
|
||||
#
|
||||
# Required secrets: DOCKERHUB_USERNAME, DOCKERHUB_TOKEN
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '[0-9]+.[0-9]+.[0-9]+'
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
packages: write
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build-linux-amd64:
|
||||
name: Build — linux/amd64
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 45
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: graalvm/setup-graalvm@v1
|
||||
with:
|
||||
java-version: '24'
|
||||
distribution: 'graalvm-community'
|
||||
cache: maven
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- run: mvn clean package -Pnative -DskipTests -B
|
||||
- run: mv target/floci target/floci-linux-amd64
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: floci-linux-amd64
|
||||
path: target/floci-linux-amd64
|
||||
|
||||
build-linux-arm64:
|
||||
name: Build — linux/arm64
|
||||
runs-on: ubuntu-24.04-arm
|
||||
timeout-minutes: 45
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: graalvm/setup-graalvm@v1
|
||||
with:
|
||||
java-version: '24'
|
||||
distribution: 'graalvm-community'
|
||||
cache: maven
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- run: mvn clean package -Pnative -DskipTests -B
|
||||
- run: mv target/floci target/floci-linux-arm64
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: floci-linux-arm64
|
||||
path: target/floci-linux-arm64
|
||||
|
||||
build-darwin-amd64:
|
||||
name: Build — darwin/amd64
|
||||
runs-on: macos-13
|
||||
timeout-minutes: 45
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: graalvm/setup-graalvm@v1
|
||||
with:
|
||||
java-version: '24'
|
||||
distribution: 'graalvm-community'
|
||||
cache: maven
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- run: mvn clean package -Pnative -DskipTests -B
|
||||
- run: mv target/floci target/floci-darwin-amd64
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: floci-darwin-amd64
|
||||
path: target/floci-darwin-amd64
|
||||
|
||||
build-darwin-arm64:
|
||||
name: Build — darwin/arm64
|
||||
runs-on: macos-latest
|
||||
timeout-minutes: 45
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: graalvm/setup-graalvm@v1
|
||||
with:
|
||||
java-version: '24'
|
||||
distribution: 'graalvm-community'
|
||||
cache: maven
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- run: mvn clean package -Pnative -DskipTests -B
|
||||
- run: mv target/floci target/floci-darwin-arm64
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: floci-darwin-arm64
|
||||
path: target/floci-darwin-arm64
|
||||
|
||||
build-windows-amd64:
|
||||
name: Build — windows/amd64
|
||||
runs-on: windows-latest
|
||||
timeout-minutes: 60
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: graalvm/setup-graalvm@v1
|
||||
with:
|
||||
java-version: '24'
|
||||
distribution: 'graalvm-community'
|
||||
cache: maven
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- run: mvn clean package -Pnative -DskipTests -B
|
||||
- run: mv target/floci.exe target/floci-windows-amd64.exe
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: floci-windows-amd64
|
||||
path: target/floci-windows-amd64.exe
|
||||
|
||||
build-jar:
|
||||
name: Build — JVM jar
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: '25'
|
||||
distribution: 'temurin'
|
||||
cache: maven
|
||||
- run: mvn clean package -DskipTests -B
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: floci-jar
|
||||
path: target/floci.jar
|
||||
|
||||
release:
|
||||
name: Create GitHub Release
|
||||
needs: [build-linux-amd64, build-linux-arm64, build-darwin-amd64, build-darwin-arm64, build-windows-amd64, build-jar]
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 20
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Extract version
|
||||
id: version
|
||||
run: echo "version=${GITHUB_REF_NAME}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: dist/
|
||||
|
||||
- name: Generate checksums
|
||||
run: |
|
||||
cd dist
|
||||
find . -type f \( -name "floci-*" \) | sort | xargs sha256sum > sha256sums.txt
|
||||
cat sha256sums.txt
|
||||
|
||||
- name: Create Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
name: "floci ${{ steps.version.outputs.version }}"
|
||||
body: |
|
||||
## Installation
|
||||
|
||||
**Homebrew:**
|
||||
```sh
|
||||
brew install floci-io/floci/floci
|
||||
```
|
||||
|
||||
**Direct download (Linux/macOS):**
|
||||
```sh
|
||||
curl -fsSL https://floci.io/install.sh | sh
|
||||
```
|
||||
|
||||
**Windows:**
|
||||
```powershell
|
||||
iwr https://floci.io/install.ps1 | iex
|
||||
```
|
||||
|
||||
**JVM fallback** (requires Java 21+): `floci.jar`
|
||||
|
||||
See [CHANGELOG.md](CHANGELOG.md) for what's new.
|
||||
files: |
|
||||
dist/floci-linux-amd64/floci-linux-amd64
|
||||
dist/floci-linux-arm64/floci-linux-arm64
|
||||
dist/floci-darwin-amd64/floci-darwin-amd64
|
||||
dist/floci-darwin-arm64/floci-darwin-arm64
|
||||
dist/floci-windows-amd64/floci-windows-amd64.exe
|
||||
dist/floci-jar/floci.jar
|
||||
dist/sha256sums.txt
|
||||
|
||||
docker:
|
||||
name: Push Docker image
|
||||
needs: [build-linux-amd64, build-linux-arm64]
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 20
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Extract version
|
||||
id: version
|
||||
run: echo "version=${GITHUB_REF_NAME}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: floci-linux-amd64
|
||||
path: docker/amd64/
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: floci-linux-arm64
|
||||
path: docker/arm64/
|
||||
|
||||
- run: chmod +x docker/amd64/floci-linux-amd64 docker/arm64/floci-linux-arm64
|
||||
|
||||
- uses: docker/setup-buildx-action@v3
|
||||
|
||||
- uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: |
|
||||
floci/cli:${{ steps.version.outputs.version }}
|
||||
floci/cli:latest
|
||||
build-args: VERSION=${{ steps.version.outputs.version }}
|
||||
Reference in new issue
Block a user