Skip to content

fix: rename JAR before upload and update README to 0.2.1 #18

fix: rename JAR before upload and update README to 0.2.1

fix: rename JAR before upload and update README to 0.2.1 #18

Workflow file for this run

name: CI
on:
push:
branches: [main]
tags: ['[0-9]*.[0-9]*.[0-9]*']
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: 'maven'
- name: Build, unit tests + integration tests
run: mvn -B verify
native:
needs: build
if: startsWith(github.ref, 'refs/tags/')
strategy:
matrix:
include:
- os: ubuntu-latest
label: linux-amd64
binary: qtsurfer-mcp
asset: qtsurfer-mcp-linux-amd64
- os: macos-latest
label: macos-arm64
binary: qtsurfer-mcp
asset: qtsurfer-mcp-macos-arm64
- os: windows-latest
label: windows-amd64
binary: qtsurfer-mcp.exe
asset: qtsurfer-mcp-windows-amd64.exe
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'graalvm'
cache: 'maven'
- name: Build native binary
run: mvn -B -Pnative -DskipTests package native:compile-no-fork
- name: Upload native binary
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.asset }}
path: target/${{ matrix.binary }}
retention-days: 1
release:
needs: [build, native]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: 'maven'
- name: Build fat JAR
run: mvn -B package -DskipTests
- name: Download native binaries
uses: actions/download-artifact@v4
with:
path: native-binaries
- name: Create GitHub Release
env:
GH_TOKEN: ${{ github.token }}
run: |
awk "/^## \[${GITHUB_REF_NAME}\]/{found=1; next} found && /^## \[/{exit} found{print}" \
CHANGELOG.md > /tmp/release-notes.md
gh release create "$GITHUB_REF_NAME" \
--title "$GITHUB_REF_NAME" \
--notes-file /tmp/release-notes.md
- name: Upload fat JAR
env:
GH_TOKEN: ${{ github.token }}
run: |
JAR=$(ls target/mcp-*.jar | grep -v 'original-' | head -1)
mv "$JAR" "qtsurfer-mcp-java-${GITHUB_REF_NAME}.jar"
gh release upload "$GITHUB_REF_NAME" "qtsurfer-mcp-java-${GITHUB_REF_NAME}.jar"
- name: Upload native binaries
env:
GH_TOKEN: ${{ github.token }}
run: |
mv native-binaries/qtsurfer-mcp-linux-amd64/qtsurfer-mcp \
native-binaries/qtsurfer-mcp-linux-amd64/qtsurfer-mcp-linux-amd64
mv native-binaries/qtsurfer-mcp-macos-arm64/qtsurfer-mcp \
native-binaries/qtsurfer-mcp-macos-arm64/qtsurfer-mcp-macos-arm64
mv "native-binaries/qtsurfer-mcp-windows-amd64.exe/qtsurfer-mcp.exe" \
"native-binaries/qtsurfer-mcp-windows-amd64.exe/qtsurfer-mcp-windows-amd64.exe"
gh release upload "$GITHUB_REF_NAME" \
native-binaries/qtsurfer-mcp-linux-amd64/qtsurfer-mcp-linux-amd64 \
native-binaries/qtsurfer-mcp-macos-arm64/qtsurfer-mcp-macos-arm64 \
"native-binaries/qtsurfer-mcp-windows-amd64.exe/qtsurfer-mcp-windows-amd64.exe"