Repository navigation
131 lines (112 loc) · 3.78 KB
/
Copy pathrelease-mcp.yml
File metadata and controls
131 lines (112 loc) · 3.78 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
130
131
name: Release MCP
on:
push:
tags:
- 'mcp@*'
workflow_dispatch:
inputs:
tag:
description: "Tag (e.g. mcp@1.2.3 or v1.2.3)"
required: false
jobs:
backend-test:
name: Backend Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup .NET
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
dotnet-version: '10.0.x'
- name: Restore dependencies
run: dotnet restore ScriptBee.slnx
- name: Build
run: dotnet build ScriptBee.slnx --no-restore
- name: Test
run: dotnet test ScriptBee.slnx --no-build --verbosity normal
mcp-build-push:
name: MCP Build & Push Docker
needs: backend-test
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
# QEMU is needed to emulate ARM instructions on an x86 runner
- name: Set up QEMU
uses: docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v4.4.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
- name: Log in to Docker Hub
uses: docker/login-action@81c6f93d4bc991e510b342a00b419b3bb4efc5c6 # v4.7.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract version from tag
id: meta
shell: bash
run: |
INPUT_TAG="${{ github.event.inputs.tag }}"
if [ -n "$INPUT_TAG" ]; then
REF_NAME="$INPUT_TAG"
else
REF_NAME="$GITHUB_REF_NAME"
fi
if [[ "$REF_NAME" == *"@"* ]]; then
VERSION="${REF_NAME#*@}"
else
VERSION="${REF_NAME#v}"
fi
VERSION="${VERSION#v}"
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Build and push MCP Docker image
uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
with:
context: .
file: ./mcp.Dockerfile
push: true
platforms: linux/amd64,linux/arm64
tags: |
dxworks/scriptbee-mcp:${{ steps.meta.outputs.version }}
dxworks/scriptbee-mcp:latest
cache-from: type=gha
cache-to: type=gha,mode=max
create-release:
name: Create GitHub Release
needs: mcp-build-push
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Extract version from tag
id: meta
shell: bash
run: |
INPUT_TAG="${{ github.event.inputs.tag }}"
if [ -n "$INPUT_TAG" ]; then
REF_NAME="$INPUT_TAG"
else
REF_NAME="$GITHUB_REF_NAME"
fi
if [[ "$REF_NAME" == *"@"* ]]; then
VERSION="${REF_NAME#*@}"
else
VERSION="${REF_NAME#v}"
fi
VERSION="${VERSION#v}"
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Extract changelog for current version
id: changelog
run: |
chmod +x ./scripts/extract_changelog.sh
./scripts/extract_changelog.sh "${{ steps.meta.outputs.version }}" Integrations/MCP/CHANGELOG.md
- name: Create Release
uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3
with:
tag_name: ${{ github.event.inputs.tag || github.ref_name }}
body_path: RELEASE_NOTES.md