Skip to content

http4k MCP Desktop Release #41

http4k MCP Desktop Release

http4k MCP Desktop Release #41

name: "http4k MCP Desktop Release"
on:
workflow_dispatch:
inputs:
version:
description: 'Version to release'
required: true
type: string
jobs:
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.2.2
- uses: actions/setup-java@v4.7.1
with:
distribution: temurin
java-version: 21
cache: gradle
- name: Set Version from Input
run: |
echo "VERSION=${{ github.event.inputs.version }}" >> "${GITHUB_ENV}"
- name: Create Release
id: create_release
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{secrets.RELEASE_TOKEN}}
with:
tag: ${{ env.VERSION }}
name: Release ${{ env.VERSION }}
body: |
http4k MCP Desktop client v${{ env.VERSION }}. See the README for usage information and CHANGELOG for the chnagelog.
allowUpdates: true
- name: Write Upload URL To File
run: |
echo "${{steps.create_release.outputs.upload_url}}" > upload_url.txt
echo "${{ env.VERSION }}" > version.txt
- name: Publish Artifacts
uses: actions/upload-artifact@v4.6.2
with:
name: release-info
path: |
upload_url.txt
version.txt
release:
needs: setup
strategy:
matrix:
os:
- macos-13
- macos-latest
- ubuntu-latest
- windows-latest
include:
- os: macos-13
label: macos-x86_64
suffix: ""
- os: macos-latest
label: macos-arm64
suffix: ""
- os: ubuntu-latest
label: linux
suffix: ""
- os: windows-latest
label: windows
suffix: ".exe"
runs-on: ${{matrix.os}}
steps:
- name: Checkout
uses: actions/checkout@v4.2.2
- name: Get Release Info
uses: actions/download-artifact@v4.3.0
with:
name: release-info
- name: Set Version
id: version
shell: bash
run: |
echo "VERSION=$(cat version.txt)" >> "${GITHUB_ENV}"
- name: Setup GraalVM
uses: graalvm/setup-graalvm@v1
with:
java-version: "21"
distribution: "graalvm"
github-token: ${{ secrets.GITHUB_TOKEN }}
version: "22.3.0"
- name: Build (Windows)
if: matrix.os == 'windows-latest'
shell: cmd
run: .\gradlew -PVERSION="%VERSION%" nativeCompile
- name: Build (Unix)
if: matrix.os != 'windows-latest'
shell: bash
run: ./gradlew -PVERSION="${VERSION}" nativeCompile
- name: Make binary executable
if: matrix.os == 'ubuntu-latest'
run: chmod +x build/native/nativeCompile/http4k-mcp-desktop
- name: Get Upload URL
if: matrix.os != 'windows-latest'
run: |
echo "UPLOAD_URL=$(cat upload_url.txt)" >> "${GITHUB_ENV}"
- name: Get Upload URL (Windows)
if: matrix.os == 'windows-latest'
shell: cmd
run: |
set /p UPLOAD_URL=<upload_url.txt
echo UPLOAD_URL=%UPLOAD_URL%>> "%GITHUB_ENV%"
- name: Get Upload URL (Unix)
if: matrix.os != 'windows-latest'
shell: bash
run: |
echo "UPLOAD_URL=$(cat upload_url.txt)" >> "${GITHUB_ENV}"
# Generate SHA256 checksum for macOS
- name: Generate SHA256 (macOS)
if: startsWith(matrix.os, 'macos')
shell: bash
run: |
cd build/native/nativeCompile/
shasum -a 256 http4k-mcp-desktop > http4k-mcp-desktop.sha256
cat http4k-mcp-desktop.sha256
# Generate SHA256 checksum for Linux
- name: Generate SHA256 (Linux)
if: matrix.os == 'ubuntu-latest'
shell: bash
run: |
cd build/native/nativeCompile/
openssl dgst -sha256 http4k-mcp-desktop | sed 's/^SHA256(http4k-mcp-desktop)= //' > http4k-mcp-desktop.sha256
cat http4k-mcp-desktop.sha256
# Generate SHA256 checksum for Windows
- name: Generate SHA256 (Windows)
if: matrix.os == 'windows-latest'
shell: cmd
run: |
cd build\native\nativeCompile
certutil -hashfile http4k-mcp-desktop.exe SHA256 | findstr /v "CertUtil" > http4k-mcp-desktop.exe.sha256
type http4k-mcp-desktop.exe.sha256
- name: Release ${{matrix.label}} Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{secrets.HTTP4K_RELEASE_TOKEN}}
with:
upload_url: ${{env.UPLOAD_URL}}
asset_name: http4k-mcp-desktop.${{matrix.label}}${{matrix.suffix}}
asset_path: build/native/nativeCompile/http4k-mcp-desktop${{matrix.suffix}}
asset_content_type: application/octet-stream
# Upload SHA256 checksum file
- name: Upload SHA256 Checksum
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{secrets.HTTP4K_RELEASE_TOKEN}}
with:
upload_url: ${{env.UPLOAD_URL}}
asset_name: http4k-mcp-desktop.${{matrix.label}}${{matrix.suffix}}.sha256
asset_path: build/native/nativeCompile/http4k-mcp-desktop${{matrix.suffix}}.sha256
asset_content_type: text/plain
homebrew:
needs:
- release
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4.2.2
- name: Get Release Info
uses: actions/download-artifact@v4.3.0
with:
name: release-info
- name: Set Version
id: version
shell: bash
run: |
echo "VERSION=$(cat version.txt)" >> "${GITHUB_ENV}"
- name: Update Homebrew formula
uses: dawidd6/action-homebrew-bump-formula@v4
with:
token: ${{secrets.HTTP4K_RELEASE_TOKEN}}
tap: http4k/tap
formula: http4k-mcp-desktop
force: true
tag: ${{ env.VERSION }}