-
Notifications
You must be signed in to change notification settings - Fork 1
129 lines (124 loc) · 3.9 KB
/
release.yml
File metadata and controls
129 lines (124 loc) · 3.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: Release
on:
push:
tags: ["v*"]
workflow_dispatch:
inputs:
dry-run:
description: "Build and validate without publishing"
type: boolean
default: true
permissions:
contents: write
packages: write
id-token: write
jobs:
build:
name: Build ${{ matrix.target }}
runs-on: ubuntu-latest
strategy:
matrix:
include:
- target: bun-linux-x64
artifact: platter-linux-x64
os: linux
arch: x64
- target: bun-linux-arm64
artifact: platter-linux-arm64
os: linux
arch: arm64
- target: bun-darwin-x64
artifact: platter-darwin-x64
os: darwin
arch: x64
- target: bun-darwin-arm64
artifact: platter-darwin-arm64
os: darwin
arch: arm64
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- run: sudo apt-get update && sudo apt-get install -y librsvg2-bin zip
- run: bun install --frozen-lockfile
- name: Compile
run: bun build src/index.ts --compile --external x11 --target=${{ matrix.target }} --outfile=dist/${{ matrix.artifact }}
- name: Pack mcpb
run: bun run pack:mcpb --os ${{ matrix.os }} --arch ${{ matrix.arch }}
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact }}
path: |
dist/${{ matrix.artifact }}
dist/${{ matrix.artifact }}.mcpb
release:
name: Create Release
if: ${{ !inputs.dry-run }}
needs: [build, docker]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- run: sudo apt-get update && sudo apt-get install -y librsvg2-bin
- run: bun install --frozen-lockfile
- uses: actions/download-artifact@v4
with:
path: artifacts
pattern: platter-*
merge-multiple: true
- name: Make binaries executable
run: chmod +x artifacts/platter-*[0-9]
- name: Build icon.png
run: bun run build:icon-png && cp dist/icon.png artifacts/icon.png
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: |
artifacts/platter-*[0-9]
artifacts/platter-*.mcpb
artifacts/icon.png
- name: Render server.json
run: |
VERSION="${GITHUB_REF_NAME#v}"
bun run render:server-json --version "$VERSION" --mcpb-dir artifacts --out server.json
cat server.json
- name: Install mcp-publisher
run: bun run install:mcp-publisher
- name: Login to MCP Registry (GitHub OIDC)
run: ./.bin/mcp-publisher login github-oidc
- name: Publish to MCP Registry
run: ./.bin/mcp-publisher publish
docker:
name: Push Docker Image
if: ${{ !inputs.dry-run }}
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=raw,value=latest
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max