Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 61 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,40 @@
name: Release

on:
push:
tags:
- "v*"
workflow_dispatch:

permissions:
contents: read
contents: write
id-token: write

jobs:
resolve-tag:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.tag.outputs.tag }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0

- name: Find latest v* tag
id: tag
run: |
TAG=$(git tag --list 'v*' --sort=-v:refname | head -1)
if [ -z "$TAG" ]; then
echo "::error::No v* tag found"
exit 1
fi
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
echo "Releasing $TAG"

test:
needs: resolve-tag
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ needs.resolve-tag.outputs.tag }}

- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
Expand All @@ -22,11 +44,12 @@ jobs:
run: go test -race ./...

release:
needs: test
needs: [resolve-tag, test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ needs.resolve-tag.outputs.tag }}
fetch-depth: 0

- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
Expand All @@ -38,14 +61,44 @@ jobs:
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}

- name: Build
- name: Build and release
uses: goreleaser/goreleaser-action@f06c13b6b1a9625abc9e6e439d9c05a8f2190e94 # v7.2.3
with:
args: release --clean --skip=publish
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GORELEASER_CURRENT_TAG: ${{ needs.resolve-tag.outputs.tag }}

- name: Upload to S3
run: ./scripts/upload-release.sh "${{ github.ref_name }}"
run: ./scripts/upload-release.sh "${{ needs.resolve-tag.outputs.tag }}"
env:
AWS_ACCESS_KEY_ID: ${{ secrets.SCW_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.SCW_SECRET_KEY }}
AWS_DEFAULT_REGION: fr-par

mcp-registry:
needs: [resolve-tag, test]
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ needs.resolve-tag.outputs.tag }}

- name: Set version from tag
run: |
VERSION=${{ needs.resolve-tag.outputs.tag }}
VERSION=${VERSION#v}
jq --arg v "$VERSION" '.version = $v' server.json > server.tmp && mv server.tmp server.json

- name: Install mcp-publisher
run: |
curl -L "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_linux_amd64.tar.gz" | tar xz mcp-publisher

- name: Authenticate to MCP Registry
run: ./mcp-publisher login github-oidc

- name: Publish to MCP Registry
run: ./mcp-publisher publish
3 changes: 2 additions & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,5 @@ signs:
signature: "${artifact}.asc"

release:
disable: true
draft: false
prerelease: auto