Skip to content

chore: update Kotlin toolchain and bump certkit version to 0.4.0 #49

chore: update Kotlin toolchain and bump certkit version to 0.4.0

chore: update Kotlin toolchain and bump certkit version to 0.4.0 #49

Workflow file for this run

name: Build
on:
push:
branches: [ main ]
tags: [ '*' ]
paths-ignore:
- '*.md'
- 'docs/**'
- LICENSE
pull_request:
branches: [ main ]
workflow_dispatch:
defaults:
run:
shell: bash
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: write
jobs:
build:
name: 🔨 Build & Test
runs-on: ubuntu-latest
steps:
- name: 📥 Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: 🅺 Cache Kotlin Toolchain
uses: sureshg/actions/kotlin-toolchain-cache@v1
- name: 🧪 Test
run: ./kotlin test
- name: 📄 Generate HTML Test Report
if: always()
env:
REPORT_DIR: build/reports/certkit/jvm
run: |
version="$(sed -nE 's/^opentest4j-reporting[[:space:]]*=[[:space:]]*"([^"]+)".*/\1/p' libs.versions.toml)"
cli_jar="open-test-reporting-cli-${version}-standalone.jar"
curl -sLO "https://repo1.maven.org/maven2/org/opentest4j/reporting/open-test-reporting-cli/${version}/${cli_jar}"
java -jar "$cli_jar" html-report "$REPORT_DIR/open-test-report.xml"
mv "$REPORT_DIR/open-test-report.html" build/reports/index.html
- name: 🌐 Publish Test Report
if: always() && github.ref == 'refs/heads/main'
uses: JamesIves/github-pages-deploy-action@v4.8.0
with:
branch: gh-pages
folder: build/reports
target-folder: reports
clean: true
commit-message: 'test: Deployed test report'
- name: 🔭 Upload build traces
if: always()
uses: actions/upload-artifact@v7
with:
name: kotlin_cli_traces.jsonl
path: build/logs/**/telemetry/amper_cli_traces.jsonl
archive: false
if-no-files-found: ignore
- name: 📡 Publish to Maven Central
if: startsWith(github.ref, 'refs/tags/')
env:
KOTLIN_TOOLCHAIN_MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
KOTLIN_TOOLCHAIN_MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
KOTLIN_TOOLCHAIN_SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
KOTLIN_TOOLCHAIN_SIGNING_KEY_PASSPHRASE: ${{ secrets.SIGNING_KEY_PASSWORD }}
run: |
version="${GITHUB_REF_NAME#v}"
echo "::notice title=Maven Central Publish::Publishing version ${version} (from tag ${GITHUB_REF_NAME})"
echo "🚀 Publishing certkit version ${version} to Maven Central (resolved from tag ${GITHUB_REF_NAME})"
sed -i -E "/^ publishing:/,/^ version:/ s|^ version: .*| version: ${version}|" module.yaml
./kotlin publish mavenCentral
- name: ✨ Create GitHub Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}