mirror of
https://github.com/floci-io/floci-cli.git
synced 2026-11-22 21:50:47 -05:00
ci: release with release-please, like the Testcontainers modules (#76)
Replace the semantic-release Release Cut button with release-please.yml: a standing release PR bumps pom.xml and CHANGELOG.md; merging it tags X.Y.Z, then the workflow publishes the binaries (release.yml, now a reusable workflow), bumps the Homebrew tap and runs CodeQL and Trivy. A workflow_dispatch tag input re-publishes an existing tag. Swap conventional-commits.yml for commit-lint.yml so the PR title is linted, exempt release PRs from the changelog guard, and demote the generated changelog headings so release-please inserts above them. Tests: mvn -B test, 811 passed. Signed-off-by: Hector Ventura <hectorvent@gmail.com>
This commit is contained in:
1 parent
3c70876448
commit
ae4bf99352
16 files changed
+271
-6284
No files matched your search
-6067
File diff suppressed because it is too large.
Load diff
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"name": "release-tooling",
|
||||
"private": true,
|
||||
"description": "Pinned semantic-release toolchain for the Release Cut workflow (npm ci only; not part of the CLI build)",
|
||||
"devDependencies": {
|
||||
"semantic-release": "24.2.9",
|
||||
"@semantic-release/changelog": "7.0.0",
|
||||
"@semantic-release/exec": "7.1.0",
|
||||
"@semantic-release/git": "11.0.1"
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,14 @@
|
||||
name: Changelog Guard
|
||||
|
||||
# CHANGELOG.md is generated by semantic-release (the Release Cut workflow) —
|
||||
# a feat, fix or perf subject becomes the release note verbatim, so PRs
|
||||
# must not edit the file by hand. Genuine corrections (typos in history,
|
||||
# security notes) are allowed by adding the `changelog-edit` label to the PR.
|
||||
# CHANGELOG.md is generated by release-please (release-please.yml): a feat,
|
||||
# fix or perf subject becomes the release note verbatim, so PRs must not edit
|
||||
# the file by hand. release-please's own release PR is the one writer and is
|
||||
# exempt: only its branch, release-please--branches--main (plus a
|
||||
# --components--<name> suffix when release-please names the package), and only
|
||||
# when that branch lives in this repository (a fork can name a branch anything;
|
||||
# pushing a branch here needs write access). Genuine corrections
|
||||
# (typos in history, security notes) are allowed by adding the
|
||||
# `changelog-edit` label to the PR.
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
@@ -17,9 +22,9 @@ jobs:
|
||||
guard:
|
||||
name: CHANGELOG.md is generated
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ !contains(github.event.pull_request.labels.*.name, 'changelog-edit') }}
|
||||
if: ${{ !contains(github.event.pull_request.labels.*.name, 'changelog-edit') && !(github.event.pull_request.head.repo.full_name == github.repository && (github.head_ref == 'release-please--branches--main' || startsWith(github.head_ref, 'release-please--branches--main--components--'))) }}
|
||||
steps:
|
||||
- name: Reject hand edits
|
||||
run: |
|
||||
echo "::error::CHANGELOG.md is generated by semantic-release — a feat, fix or perf subject becomes the release note, so hand edits conflict with the release commit. Remove the CHANGELOG.md changes from this PR, or ask a maintainer for the 'changelog-edit' label if this is a genuine correction."
|
||||
echo "::error::CHANGELOG.md is generated by release-please: a feat, fix or perf subject becomes the release note, so hand edits conflict with the release PR. Remove the CHANGELOG.md changes from this PR, or ask a maintainer for the 'changelog-edit' label if this is a genuine correction."
|
||||
exit 1
|
||||
@@ -0,0 +1,33 @@
|
||||
name: Commit lint
|
||||
|
||||
# Its own workflow, with no path filters, so every pull request is checked: its commits and its
|
||||
# title, which becomes the commit message when the pull request is squash-merged and so decides
|
||||
# what release-please does with it.
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, edited, synchronize, reopened]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
commit-lint:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Check the commits
|
||||
uses: wagoid/commitlint-github-action@b948419dd99f3fd78a6548d48f94e3df7f6bf3ed # v6.2.1
|
||||
|
||||
- name: Check the pull request title
|
||||
env:
|
||||
TITLE: ${{ github.event.pull_request.title }}
|
||||
run: |
|
||||
dir="$RUNNER_TEMP/commitlint"
|
||||
mkdir -p "$dir" && cp commitlint.config.mjs "$dir/" && cd "$dir"
|
||||
npm install --no-save --no-package-lock --no-audit --no-fund \
|
||||
@commitlint/cli@19.8.1 @commitlint/config-conventional@19.8.1 >/dev/null
|
||||
printf '%s\n' "$TITLE" | npx --no-install commitlint
|
||||
@@ -1,63 +0,0 @@
|
||||
name: Conventional Commits
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, edited, synchronize, reopened]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
lint-commits:
|
||||
name: Commits follow Conventional Commits
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Validate commit messages
|
||||
env:
|
||||
BASE_SHA: ${{ github.event.pull_request.base.sha }}
|
||||
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
|
||||
run: |
|
||||
# Conventional Commits pattern:
|
||||
# <type>[optional scope]: <description>
|
||||
#
|
||||
# Types recognised by semantic-release (commit-analyzer defaults):
|
||||
# feat, fix, perf, revert, docs, style, chore, refactor, test, build, ci
|
||||
#
|
||||
# Breaking changes are signalled by appending ! before the colon:
|
||||
# feat!: or feat(scope)!:
|
||||
#
|
||||
# Merge commits are skipped automatically via --no-merges.
|
||||
#
|
||||
# References:
|
||||
# https://www.conventionalcommits.org/en/v1.0.0/
|
||||
|
||||
PATTERN='^(feat|fix|perf|revert|docs|style|chore|refactor|test|build|ci)(\([-a-zA-Z0-9_.,]+\))?!?: .{1,}'
|
||||
FAILED=0
|
||||
|
||||
while IFS= read -r msg; do
|
||||
if echo "$msg" | grep -qE "$PATTERN"; then
|
||||
echo "ok: $msg"
|
||||
else
|
||||
echo "::error::Commit does not follow Conventional Commits: $msg"
|
||||
echo ""
|
||||
echo " Got: $msg"
|
||||
echo ""
|
||||
echo " Expected format: <type>[optional scope]: <description>"
|
||||
echo " Examples:"
|
||||
echo " feat(pubsub): add subscription filter support"
|
||||
echo " fix(gcs): correct ETag format for multipart uploads"
|
||||
echo " chore: release 1.0.0"
|
||||
echo " feat!: remove legacy endpoint"
|
||||
echo ""
|
||||
echo " Valid types: feat, fix, perf, revert, docs, style, chore, refactor, test, build, ci"
|
||||
echo " See: https://www.conventionalcommits.org/en/v1.0.0/"
|
||||
FAILED=1
|
||||
fi
|
||||
done < <(git log --no-merges --format="%s" "$BASE_SHA".."$HEAD_SHA")
|
||||
|
||||
exit $FAILED
|
||||
@@ -1,14 +1,17 @@
|
||||
name: Homebrew Bump
|
||||
|
||||
# Triggered after release.yml succeeds on a version tag.
|
||||
# Called by release-please.yml after the publish job has attached the binaries to the release.
|
||||
# Opens a PR in floci-io/homebrew-floci with the new version and SHA256.
|
||||
#
|
||||
# Required secrets: GH_TOKEN (PAT with repo scope on homebrew-floci repo)
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: [Release]
|
||||
types: [completed]
|
||||
workflow_call:
|
||||
inputs:
|
||||
tag:
|
||||
description: Release tag whose binaries the formula should point at (e.g. 0.5.0)
|
||||
required: true
|
||||
type: string
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -17,14 +20,13 @@ 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"
|
||||
env:
|
||||
TAG: ${{ inputs.tag }}
|
||||
run: echo "version=${TAG}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Download release checksums
|
||||
run: |
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
name: Release Cut
|
||||
|
||||
# One-button release from main.
|
||||
#
|
||||
# Manually dispatched: semantic-release analyzes the Conventional Commits on
|
||||
# main, bumps pom.xml (via the exec plugin running `mvn versions:set`), writes
|
||||
# CHANGELOG.md, commits those files, tags the release (tagFormat: ${version}),
|
||||
# and creates the GitHub Release. The tag push then fires release.yml exactly
|
||||
# as a manual tag push does today.
|
||||
#
|
||||
# GH_TOKEN must be a fine-grained PAT with contents:write. The default
|
||||
# GITHUB_TOKEN cannot be used: tags pushed with it do not trigger other
|
||||
# workflows (GitHub's recursion guard), so release.yml would never run.
|
||||
#
|
||||
# Maven note: the exec plugin invokes `mvn versions:set`; ubuntu-latest ships
|
||||
# a system mvn, which is sufficient for that goal.
|
||||
#
|
||||
# The toolchain is pinned: .github/release-tooling/package-lock.json is the
|
||||
# only source of the semantic-release dependency tree (npm ci --ignore-scripts),
|
||||
# so the job that holds the write PAT never resolves mutable versions.
|
||||
#
|
||||
# Required secrets: GH_TOKEN
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
dry-run:
|
||||
description: 'Dry run (compute the next version and release notes without releasing)'
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
# Serialize release cuts: a second dispatch queues behind the first instead of
|
||||
# racing it to the same version/tag. No cancel-in-progress — never kill a
|
||||
# mid-flight release. GitHub keeps at most ONE pending run per group, so if
|
||||
# several dispatches pile up, only the latest pending one runs — intentional:
|
||||
# duplicate queued release cuts are redundant by definition (the surviving run
|
||||
# re-analyzes main and releases whatever is unreleased).
|
||||
concurrency:
|
||||
group: release-cut
|
||||
|
||||
jobs:
|
||||
release:
|
||||
name: Cut release from main
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
ref: main
|
||||
token: ${{ secrets.GH_TOKEN }}
|
||||
fetch-depth: 0
|
||||
|
||||
- uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0
|
||||
with:
|
||||
java-version: '25'
|
||||
distribution: 'temurin'
|
||||
cache: maven
|
||||
|
||||
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
|
||||
with:
|
||||
node-version: 22
|
||||
|
||||
- name: Install the pinned release toolchain
|
||||
run: npm ci --prefix .github/release-tooling --ignore-scripts
|
||||
|
||||
- name: Run semantic-release
|
||||
run: ./.github/release-tooling/node_modules/.bin/semantic-release ${{ inputs.dry-run && '--dry-run' || '' }}
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||
@@ -0,0 +1,132 @@
|
||||
name: Release Please
|
||||
|
||||
# Releases floci-cli the way the Testcontainers modules do (decision 0023 in floci-loft).
|
||||
#
|
||||
# On every push to main, release-please keeps one release PR open with the next version in
|
||||
# pom.xml and the CHANGELOG.md entry. Merging that PR tags the release (plain X.Y.Z, no "v",
|
||||
# which the installers, the update notifier and the Homebrew formula rely on) and creates the
|
||||
# GitHub Release. The jobs below then build and attach the binaries, bump the Homebrew tap and
|
||||
# scan the tag.
|
||||
#
|
||||
# GH_TOKEN must be a fine-grained PAT with contents and pull-requests write on this repo, plus
|
||||
# write on floci-io/homebrew-floci for the Homebrew bump. The default GITHUB_TOKEN cannot be
|
||||
# used: PRs it opens do not run CI (GitHub's recursion guard).
|
||||
#
|
||||
# Required secrets: GH_TOKEN
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: >-
|
||||
Existing release tag to (re)publish and security-scan (e.g. 0.5.0), bypassing the
|
||||
release-please gate. Use this to recover a release whose tag/GitHub Release was created
|
||||
out-of-band (so release-please never reported release_created=true) or to re-run a failed
|
||||
publish/security-scan job. Leave empty to run release-please normally: it may update the
|
||||
release PR, or tag and publish a release PR that has been merged.
|
||||
required: false
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
# Step 1: Maintain the release PR (version bump in pom.xml + changelog) and, once it is merged,
|
||||
# tag the release and create the GitHub Release.
|
||||
release-please:
|
||||
# A tag recovery skips this job, so a release-please failure (e.g. an expired GH_TOKEN) cannot
|
||||
# block re-publishing an existing tag.
|
||||
if: inputs.tag == ''
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
issues: write
|
||||
outputs:
|
||||
release-created: ${{ steps.release.outputs.release_created }}
|
||||
tag-name: ${{ steps.release.outputs.tag_name }}
|
||||
steps:
|
||||
- uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0
|
||||
id: release
|
||||
with:
|
||||
token: ${{ secrets.GH_TOKEN }}
|
||||
target-branch: main
|
||||
config-file: release-please-config.json
|
||||
manifest-file: .release-please-manifest.json
|
||||
|
||||
# Step 2: Build the native binaries and the jar from the tag, smoke-test them and attach them
|
||||
# to the GitHub Release.
|
||||
publish:
|
||||
needs: release-please
|
||||
if: >-
|
||||
!cancelled() && (inputs.tag != '' ||
|
||||
(needs.release-please.result == 'success' && needs.release-please.outputs.release-created == 'true'))
|
||||
permissions:
|
||||
contents: write
|
||||
uses: ./.github/workflows/release.yml
|
||||
with:
|
||||
tag: ${{ inputs.tag || needs.release-please.outputs.tag-name }}
|
||||
secrets: inherit
|
||||
|
||||
# Step 3: Open the formula bump PR in floci-io/homebrew-floci once the binaries are published.
|
||||
homebrew:
|
||||
needs: [release-please, publish]
|
||||
if: ${{ !cancelled() && needs.publish.result == 'success' }}
|
||||
permissions:
|
||||
contents: read
|
||||
uses: ./.github/workflows/homebrew-bump.yml
|
||||
with:
|
||||
tag: ${{ inputs.tag || needs.release-please.outputs.tag-name }}
|
||||
secrets: inherit
|
||||
|
||||
# Step 4: Run security scanners against the release tag
|
||||
security-scan:
|
||||
needs: release-please
|
||||
if: >-
|
||||
!cancelled() && (inputs.tag != '' ||
|
||||
(needs.release-please.result == 'success' && needs.release-please.outputs.release-created == 'true'))
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
security-events: write
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
ref: refs/tags/${{ inputs.tag || needs.release-please.outputs.tag-name }}
|
||||
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4.38.2
|
||||
with:
|
||||
languages: java-kotlin
|
||||
|
||||
- name: Set up JDK 25
|
||||
uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
|
||||
with:
|
||||
java-version: '25'
|
||||
distribution: 'temurin'
|
||||
cache: 'maven'
|
||||
|
||||
- name: Build for analysis
|
||||
run: mvn -B compile -DskipTests
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4.38.2
|
||||
|
||||
- name: Run Trivy vulnerability scanner
|
||||
uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0
|
||||
with:
|
||||
scan-type: fs
|
||||
format: sarif
|
||||
output: trivy-results.sarif
|
||||
severity: CRITICAL,HIGH
|
||||
|
||||
- name: Upload Trivy results to GitHub Security
|
||||
uses: github/codeql-action/upload-sarif@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4.38.2
|
||||
if: always()
|
||||
with:
|
||||
sarif_file: trivy-results.sarif
|
||||
category: trivy
|
||||
|
||||
- name: Submit Dependency Snapshot
|
||||
uses: advanced-security/maven-dependency-submission-action@a64327a7329c9939cf675e458452febe1894a70c # v6.0.1
|
||||
@@ -1,19 +1,24 @@
|
||||
name: Release
|
||||
|
||||
# Triggered when a SemVer tag (e.g. 0.1.0) is pushed.
|
||||
# Builds native binaries for 5 platform targets, runs each one (.github/scripts/smoke.sh) and
|
||||
# creates a GitHub Release. A binary that does not start fails its job before anything is published.
|
||||
# Called by release-please.yml (the publish job) with the release tag, after release-please has
|
||||
# tagged the release and created the GitHub Release; also reached through its workflow_dispatch
|
||||
# `tag` input to re-publish an existing tag. Builds native binaries for 5 platform targets from
|
||||
# the tag, runs each one (.github/scripts/smoke.sh) and attaches them, the jar and sha256sums.txt
|
||||
# to that release. A binary that does not start fails its job before anything is uploaded.
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '[0-9]+.[0-9]+.[0-9]+'
|
||||
workflow_call:
|
||||
inputs:
|
||||
tag:
|
||||
description: Release tag to build and publish (e.g. 0.5.0)
|
||||
required: true
|
||||
type: string
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
group: ${{ github.workflow }}-${{ inputs.tag }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
@@ -23,6 +28,8 @@ jobs:
|
||||
timeout-minutes: 45
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: refs/tags/${{ inputs.tag }}
|
||||
- uses: graalvm/setup-graalvm@v1
|
||||
with:
|
||||
java-version: '25'
|
||||
@@ -32,7 +39,9 @@ jobs:
|
||||
- run: mvn clean package -Pnative -DskipTests -B
|
||||
- run: mv target/floci target/floci-linux-amd64
|
||||
- name: Smoke test
|
||||
run: .github/scripts/smoke.sh target/floci-linux-amd64 "$GITHUB_REF_NAME"
|
||||
env:
|
||||
INPUT_TAG: ${{ inputs.tag }}
|
||||
run: .github/scripts/smoke.sh target/floci-linux-amd64 "$INPUT_TAG"
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: floci-linux-amd64
|
||||
@@ -44,6 +53,8 @@ jobs:
|
||||
timeout-minutes: 45
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: refs/tags/${{ inputs.tag }}
|
||||
- uses: graalvm/setup-graalvm@v1
|
||||
with:
|
||||
java-version: '25'
|
||||
@@ -53,7 +64,9 @@ jobs:
|
||||
- run: mvn clean package -Pnative -DskipTests -B
|
||||
- run: mv target/floci target/floci-linux-arm64
|
||||
- name: Smoke test
|
||||
run: .github/scripts/smoke.sh target/floci-linux-arm64 "$GITHUB_REF_NAME"
|
||||
env:
|
||||
INPUT_TAG: ${{ inputs.tag }}
|
||||
run: .github/scripts/smoke.sh target/floci-linux-arm64 "$INPUT_TAG"
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: floci-linux-arm64
|
||||
@@ -65,6 +78,8 @@ jobs:
|
||||
timeout-minutes: 45
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: refs/tags/${{ inputs.tag }}
|
||||
- uses: graalvm/setup-graalvm@v1
|
||||
with:
|
||||
java-version: '25'
|
||||
@@ -74,7 +89,9 @@ jobs:
|
||||
- run: mvn clean package -Pnative -DskipTests -B
|
||||
- run: mv target/floci target/floci-darwin-arm64
|
||||
- name: Smoke test
|
||||
run: .github/scripts/smoke.sh target/floci-darwin-arm64 "$GITHUB_REF_NAME"
|
||||
env:
|
||||
INPUT_TAG: ${{ inputs.tag }}
|
||||
run: .github/scripts/smoke.sh target/floci-darwin-arm64 "$INPUT_TAG"
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: floci-darwin-arm64
|
||||
@@ -91,6 +108,8 @@ jobs:
|
||||
timeout-minutes: 45
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: refs/tags/${{ inputs.tag }}
|
||||
|
||||
- name: Install Rosetta 2
|
||||
run: sudo softwareupdate --install-rosetta --agree-to-license
|
||||
@@ -115,7 +134,9 @@ jobs:
|
||||
|
||||
- run: mv target/floci target/floci-darwin-amd64
|
||||
- name: Smoke test
|
||||
run: .github/scripts/smoke.sh target/floci-darwin-amd64 "$GITHUB_REF_NAME"
|
||||
env:
|
||||
INPUT_TAG: ${{ inputs.tag }}
|
||||
run: .github/scripts/smoke.sh target/floci-darwin-amd64 "$INPUT_TAG"
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: floci-darwin-amd64
|
||||
@@ -127,6 +148,8 @@ jobs:
|
||||
timeout-minutes: 60
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: refs/tags/${{ inputs.tag }}
|
||||
- uses: graalvm/setup-graalvm@v1
|
||||
with:
|
||||
java-version: '25'
|
||||
@@ -137,7 +160,9 @@ jobs:
|
||||
- run: mv target/floci.exe target/floci-windows-amd64.exe
|
||||
- name: Smoke test
|
||||
shell: bash
|
||||
run: .github/scripts/smoke.sh target/floci-windows-amd64.exe "$GITHUB_REF_NAME"
|
||||
env:
|
||||
INPUT_TAG: ${{ inputs.tag }}
|
||||
run: .github/scripts/smoke.sh target/floci-windows-amd64.exe "$INPUT_TAG"
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: floci-windows-amd64
|
||||
@@ -149,6 +174,8 @@ jobs:
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: refs/tags/${{ inputs.tag }}
|
||||
- uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: '25'
|
||||
@@ -161,16 +188,20 @@ jobs:
|
||||
path: target/floci.jar
|
||||
|
||||
release:
|
||||
name: Create GitHub Release
|
||||
name: Attach assets to the 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
|
||||
with:
|
||||
ref: refs/tags/${{ inputs.tag }}
|
||||
|
||||
- name: Extract version
|
||||
id: version
|
||||
run: echo "version=${GITHUB_REF_NAME}" >> "$GITHUB_OUTPUT"
|
||||
env:
|
||||
INPUT_TAG: ${{ inputs.tag }}
|
||||
run: echo "version=${INPUT_TAG}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
@@ -195,6 +226,9 @@ jobs:
|
||||
- name: Create Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
# Attach to the release release-please created; with no body input the action keeps
|
||||
# release-please's notes and only sets the name and uploads the files.
|
||||
tag_name: ${{ inputs.tag }}
|
||||
name: "floci ${{ steps.version.outputs.version }}"
|
||||
files: |
|
||||
dist/floci-linux-amd64/floci-linux-amd64
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
".": "0.4.0"
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
{
|
||||
"tagFormat": "${version}",
|
||||
"branches": [
|
||||
"main"
|
||||
],
|
||||
"plugins": [
|
||||
"@semantic-release/commit-analyzer",
|
||||
"@semantic-release/release-notes-generator",
|
||||
[
|
||||
"@semantic-release/changelog",
|
||||
{
|
||||
"changelogFile": "CHANGELOG.md",
|
||||
"changelogTitle": "# Changelog\n\nEntries in this file are generated by [semantic-release](https://github.com/semantic-release/semantic-release) from Conventional Commit messages — do not edit it by hand. A `feat`, `fix` or `perf` subject becomes a release note verbatim; the other accepted types produce no entry. Historic sections at the bottom were maintained by hand in the Keep a Changelog format."
|
||||
}
|
||||
],
|
||||
[
|
||||
"@semantic-release/exec",
|
||||
{
|
||||
"prepareCmd": "mvn versions:set -DnewVersion=${nextRelease.version} -DgenerateBackupPoms=false"
|
||||
}
|
||||
],
|
||||
[
|
||||
"@semantic-release/git",
|
||||
{
|
||||
"assets": [
|
||||
"pom.xml",
|
||||
"CHANGELOG.md"
|
||||
],
|
||||
"message": "chore(release): ${nextRelease.version}\n\n${nextRelease.notes}"
|
||||
}
|
||||
],
|
||||
"@semantic-release/github"
|
||||
]
|
||||
}
|
||||
@@ -180,6 +180,6 @@ printer.error("Container 'floci' not found.\nRun 'floci start' to launch one.");
|
||||
- The `Exit Codes` table in `README.md` is the contract scripts rely on. A change to what a command returns updates that table in the same change.
|
||||
- `skills/floci/` is the agent skill published from this repo (`.claude-plugin/marketplace.json` exposes it as a Claude Code plugin, and the root `plugin.json` as a Kiro power in the Agent Plugins format, whose `skills/` folder must stay next to the manifest; bump its `version` when the skill changes). Agents run what it says, so a change to a command, a flag, what `env` prints or an exit code updates the skill in the same change; `SkillDocsTest` fails when the skill quotes a command or flag that does not exist. Emulator facts (coverage, variables, URLs) are not copied into it beyond what is needed to get started: the skill sends the agent to the published docs (`references/docs.md`). Verify anything you add against the emulator's `main` branch docs, and keep `SKILL.md` frontmatter to `name` and `description`.
|
||||
- The README header (logo, tagline, badges, nav row), the `The Floci emulators` table and the closing Testcontainers / Community / License / trademark footer follow the Floci family pattern, with `floci-io/testcontainers-floci`'s README as the reference. Keep them in step with it rather than restyling them here.
|
||||
- `CHANGELOG.md` is generated by semantic-release from Conventional Commit messages; **never edit it by hand**. A `feat`, `fix` or `perf` subject (or a breaking change) becomes a release note verbatim, so write those from the user's point of view: what was broken or what is new, not how it was implemented. The other accepted types (`docs`, `chore`, `refactor`, `test`, `build`, `ci`) pass CI but produce no release and no entry. `changelog-guard.yml` fails any PR that touches the file; genuine corrections to history need the `changelog-edit` label.
|
||||
- `CHANGELOG.md` is generated by release-please from Conventional Commit messages (the squash-merged PR title on `main`); **never edit it by hand**. A `feat`, `fix` or `perf` subject (or a breaking change) becomes a release note verbatim, so write those from the user's point of view: what was broken or what is new, not how it was implemented. The other accepted types (`docs`, `chore`, `refactor`, `test`, `build`, `ci`) pass CI but produce no release and no entry. `changelog-guard.yml` fails any PR that touches the file; genuine corrections to history need the `changelog-edit` label.
|
||||
- **No em or en dashes** (U+2014, U+2013) in tracked Markdown or in issue and PR text: use a colon, semicolon, comma, parentheses or a new sentence instead. `CHANGELOG.md` is exempt (generated from commit subjects).
|
||||
- `CLAUDE.md` is gitignored (maintainer-local); this file (`AGENTS.md`) is the tracked source of truth for agent guidance. Update it here.
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
# Changelog
|
||||
|
||||
Entries in this file are generated by [semantic-release](https://github.com/semantic-release/semantic-release) from Conventional Commit messages — do not edit it by hand. A `feat`, `fix` or `perf` subject becomes a release note verbatim; the other accepted types produce no entry. Historic sections at the bottom were maintained by hand in the Keep a Changelog format.
|
||||
Entries in this file are generated by [release-please](https://github.com/googleapis/release-please) from Conventional Commit messages; do not edit it by hand. A `feat`, `fix` or `perf` subject becomes a release note verbatim; the other accepted types produce no entry. Historic sections at the bottom were maintained by hand in the Keep a Changelog format.
|
||||
|
||||
# [0.4.0](https://github.com/floci-io/floci-cli/compare/0.3.0...0.4.0) (2026-10-12)
|
||||
## [0.4.0](https://github.com/floci-io/floci-cli/compare/0.3.0...0.4.0) (2026-10-12)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
@@ -34,7 +34,7 @@ Entries in this file are generated by [semantic-release](https://github.com/sema
|
||||
* **reset:** add floci reset to delete every resource in a running emulator ([#55](https://github.com/floci-io/floci-cli/issues/55)) ([fa306b3](https://github.com/floci-io/floci-cli/commit/fa306b38a65559020a9fba490773f51342874da3))
|
||||
* **start:** check the host port before starting and explain a missing Docker socket ([#51](https://github.com/floci-io/floci-cli/issues/51)) ([4cd39a9](https://github.com/floci-io/floci-cli/commit/4cd39a957a88a185b2983cdbb7fee14031839f24))
|
||||
|
||||
# [0.3.0](https://github.com/floci-io/floci-cli/compare/0.2.3...0.3.0) (2026-10-09)
|
||||
## [0.3.0](https://github.com/floci-io/floci-cli/compare/0.2.3...0.3.0) (2026-10-09)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
+8
-4
@@ -116,11 +116,13 @@ fix(start): mount host persistent path to /app/data in container
|
||||
chore: release 0.1.8
|
||||
```
|
||||
|
||||
PRs are squash-merged, so the **PR title** becomes the commit on `main` that release-please reads. The commit-lint check validates both your commits and the PR title.
|
||||
|
||||
Do not include `Co-Authored-By` trailers for AI tools in commit messages. Attribution should be limited to human contributors.
|
||||
|
||||
## Changelog
|
||||
|
||||
`CHANGELOG.md` is generated by [semantic-release](https://github.com/semantic-release/semantic-release) from Conventional Commit messages. **Do not edit it by hand**. A `feat`, `fix` or `perf` subject (or a breaking change) becomes a release note verbatim, so write those from the user's point of view: what was broken or what's new, not how it was implemented. The other accepted types (`docs`, `chore`, `refactor`, `test`, `build`, `ci`) pass CI but produce no release and no entry, which is normal and needs no action. Genuine corrections to the file (typos in history, security notes) require the `changelog-edit` label on the PR.
|
||||
`CHANGELOG.md` is generated by [release-please](https://github.com/googleapis/release-please) from Conventional Commit messages. **Do not edit it by hand**. A `feat`, `fix` or `perf` subject (or a breaking change) becomes a release note verbatim, so write those from the user's point of view: what was broken or what's new, not how it was implemented. The other accepted types (`docs`, `chore`, `refactor`, `test`, `build`, `ci`) pass CI but produce no release and no entry, which is normal and needs no action. Genuine corrections to the file (typos in history, security notes) require the `changelog-edit` label on the PR.
|
||||
|
||||
## Pull Request Guidelines
|
||||
|
||||
@@ -154,11 +156,13 @@ Once your current pull requests are reviewed, merged, or closed, you are welcome
|
||||
Releases are cut when there is something worth shipping. Unlike the emulators, floci-cli is
|
||||
not on a fixed train.
|
||||
|
||||
Releases are cut from `main` with the **Release Cut** workflow (Actions → Release Cut → Run workflow). semantic-release analyzes the Conventional Commits since the last tag, bumps `<version>` in `pom.xml`, regenerates `CHANGELOG.md`, commits, tags, and publishes the GitHub Release. Use the `dry-run` input to preview the next version and release notes without releasing anything.
|
||||
Releases are made with [release-please](https://github.com/googleapis/release-please) (`.github/workflows/release-please.yml`). On every push to `main` it keeps one release PR open, titled `chore(main): release X.Y.Z`, which bumps `<version>` in `pom.xml` and adds the `CHANGELOG.md` entry for the Conventional Commits since the last release. To release, review that PR (the version and notes can be edited there) and merge it.
|
||||
|
||||
The tag push then triggers `release.yml` exactly as a manual tag push did before: native binaries for linux/amd64, linux/arm64, darwin/amd64, darwin/arm64 and windows/amd64, plus the fat JAR, published as a GitHub Release with `sha256sums.txt`. A successful release triggers `homebrew-bump.yml`, which opens a version-bump PR against the Homebrew tap automatically.
|
||||
Merging the release PR tags the release (plain `X.Y.Z`, no `v`) and creates the GitHub Release. The same workflow then builds native binaries for linux/amd64, linux/arm64, darwin/amd64, darwin/arm64 and windows/amd64 plus the fat JAR (`release.yml`), smoke-tests each binary and attaches them with `sha256sums.txt` to the release, opens the formula bump PR against the Homebrew tap (`homebrew-bump.yml`), and runs CodeQL and Trivy against the tag.
|
||||
|
||||
Nothing is published on PR merge: only a release cut produces artifacts.
|
||||
If a publish step fails, re-run it without cutting a new version: Actions → Release Please → Run workflow, with `tag` set to the existing tag (e.g. `0.5.0`).
|
||||
|
||||
Nothing is published on any other PR merge: only merging the release PR produces artifacts.
|
||||
|
||||
## Reporting Security Issues
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
export default {
|
||||
extends: ['@commitlint/config-conventional'],
|
||||
rules: {
|
||||
'subject-case': [0],
|
||||
'subject-full-stop': [0],
|
||||
'header-max-length': [2, 'always', 130],
|
||||
'body-max-line-length': [0],
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
|
||||
"release-type": "maven",
|
||||
"changelog-path": "CHANGELOG.md",
|
||||
"include-component-in-tag": false,
|
||||
"include-v-in-tag": false,
|
||||
"skip-snapshot": true,
|
||||
"signoff": "Hector Ventura <hectorvent@gmail.com>",
|
||||
"last-release-sha": "5f2a1018a446f89299d1d27a0d8236f7ed51bc1f",
|
||||
"packages": {
|
||||
".": {}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user