diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2c983be..6b8816b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -49,11 +49,14 @@ jobs: if: runner.os != 'Windows' run: | mv target/${{ matrix.artifact }} ai-commit-${{ matrix.platform }} + cp target/bom.json ai-commit-${{ matrix.platform }}.bom.json chmod +x ai-commit-${{ matrix.platform }} - name: Rename Artifact (Windows) if: runner.os == 'Windows' - run: Move-Item target/${{ matrix.artifact }} ai-commit-${{ matrix.platform }}.exe + run: | + Move-Item target/${{ matrix.artifact }} ai-commit-${{ matrix.platform }}.exe + Copy-Item target/bom.json ai-commit-${{ matrix.platform }}.bom.json - name: Generate SHA256 (Unix) if: runner.os != 'Windows' @@ -80,6 +83,8 @@ jobs: if: startsWith(github.ref, 'refs/tags/v') permissions: contents: write + id-token: write + attestations: write steps: - name: Checkout @@ -91,6 +96,11 @@ jobs: path: artifacts merge-multiple: true + - name: Attest Build Provenance + uses: actions/attest@1e69f48acb82d1966a394da916b4c1698aa569d6 # v4.2.2 + with: + subject-path: 'artifacts/**/*' + - name: Display Structure run: ls -R artifacts || ls -R . diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ac3af2..f44d365 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Single staged-diff fetch per run; bounded process capture; release builds run `mvn clean verify` (tests + coverage gate, no skips). - Dependency hygiene: slf4j 2.0.20, JUnit 6.1.3, Mockito 5.23.0, maven-compiler 3.15.0, maven-shade 3.6.2, maven-surefire 3.5.6, native-maven-plugin 0.11.5. - GitHub Actions moved to Node 24 runtimes: checkout v5, cache v5, upload-artifact v6, download-artifact v7, gh-release v3 (setup-graalvm v1 already current). +- Native image hardened: removed deprecated `--allow-incomplete-classpath`, unsafe ServiceLoader disable, stale logback/slf4j build-time init, broad resource globs, and deprecated URL-protocol flags (https handlers now in reachability metadata); default `-O2` for releases. +- Supply chain: CycloneDX SBOM (`bom.json`) generated on every build and attached to releases; SLSA build provenance attested keylessly via GitHub OIDC. ### Technical - JaCoCo 0.8.15 enforces 90% line + branch coverage on `verify` (currently 96.2% line, 90.5% branch across 168 tests). diff --git a/README.md b/README.md index 8d6379e..853184b 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ So I built this. A standalone CLI that works everywhere, supports any OpenAI-com ### Option 1: One-Line Installer (Easiest) -Installers verify the release SHA256 checksum before installing. Pin a version with `AI_COMMIT_VERSION=vX.Y.Z`, or verify without installing via `--verify-only`. +Installers verify the release SHA256 checksum before installing. Pin a version with `AI_COMMIT_VERSION=vX.Y.Z`, or verify without installing via `--verify-only`. Every release also ships a CycloneDX SBOM (`ai-commit-.bom.json`) and keyless SLSA build-provenance attestations (check with `gh attestation verify -R kxng0109/ai-commit-cli`). **Linux/macOS:** ```bash diff --git a/pom.xml b/pom.xml index f9e0cff..6f62369 100644 --- a/pom.xml +++ b/pom.xml @@ -181,28 +181,10 @@ ai-commit ${main.class} - -H:+UnlockExperimentalVMOptions - -H:+RemoveUnusedSymbols --no-fallback - --enable-url-protocols=https,http - --enable-https -H:+ReportExceptionStackTraces - - -H:IncludeResources=.*\.properties$ - -H:IncludeResources=.*\.xml$ - -H:IncludeResources=.*\.json$ - -H:IncludeResources=META-INF/.* - -H:IncludeResources=org/springframework/.* - - --initialize-at-build-time=org.slf4j,ch.qos.logback --initialize-at-run-time=io.netty,reactor.netty - - -Ob - --gc=serial - -H:-UseServiceLoaderFeature -march=compatibility - - --allow-incomplete-classpath @@ -262,6 +244,19 @@ + + org.cyclonedx + cyclonedx-maven-plugin + 2.9.3 + + + verify + + makeAggregateBom + + + + \ No newline at end of file diff --git a/src/main/resources/META-INF/native-image/io.github.kxng0109/ai-commit-cli/reachability-metadata.json b/src/main/resources/META-INF/native-image/io.github.kxng0109/ai-commit-cli/reachability-metadata.json index fb53ca9..14aef5d 100644 --- a/src/main/resources/META-INF/native-image/io.github.kxng0109/ai-commit-cli/reachability-metadata.json +++ b/src/main/resources/META-INF/native-image/io.github.kxng0109/ai-commit-cli/reachability-metadata.json @@ -928,6 +928,14 @@ "allDeclaredConstructors": true, "allPublicConstructors": true }, + { + "type": "sun.net.www.protocol.http.Handler", + "allDeclaredConstructors": true + }, + { + "type": "sun.net.www.protocol.https.Handler", + "allDeclaredConstructors": true + }, { "type": "org.slf4j.spi.LocationAwareLogger" },