-
Notifications
You must be signed in to change notification settings - Fork 126
146 lines (122 loc) · 4.36 KB
/
Copy pathrelease.yml
File metadata and controls
146 lines (122 loc) · 4.36 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: Release dbt-mcp
permissions:
contents: write
on:
push:
branches:
- main
paths:
- CHANGELOG.md
jobs:
create-release-tag:
runs-on: ubuntu-latest
outputs:
changie-latest: ${{ steps.changie-latest.outputs.output }}
if: "startsWith(github.event.head_commit.message, 'version:')"
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # actions/checkout@v4
- uses: ./.github/actions/setup-python
- name: Get the latest version
id: changie-latest
uses: miniscruff/changie-action@6dcc2533cac0495148ed4046c438487e4dceaa23
with:
version: latest
args: latest
- name: Create tag
env:
TAG: ${{ steps.changie-latest.outputs.output }}
run: |
git config user.name "release-bot"
git config user.email "release-bot@users.noreply.github.com"
git tag "$TAG"
git push origin "$TAG"
pypi-publish:
runs-on: ubuntu-latest
needs: create-release-tag
environment:
name: pypi
permissions:
id-token: write
steps:
- name: checkout code
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # actions/checkout@v4
with:
ref: ${{ needs.create-release-tag.outputs.changie-latest }}
fetch-tags: true
- name: setup python
uses: ./.github/actions/setup-python
id: setup-python
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda
with:
version: 10
- name: Install go-task
run: sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin
- name: Run tests
run: task test:unit
- name: Build
run: task build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc
with:
packages-dir: ./dist
create-github-release:
runs-on: ubuntu-latest
needs: create-release-tag
permissions:
contents: write # required to create a release
steps:
- name: Checkout code
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # actions/checkout@v4
with:
fetch-depth: 0 # Fetches all history for changie to work correctly
- name: Get the latest version
id: changie-latest
uses: miniscruff/changie-action@6dcc2533cac0495148ed4046c438487e4dceaa23
with:
version: latest
args: latest
- name: Create GitHub Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ steps.changie-latest.outputs.output }}
run: |
echo "Creating release for version: $VERSION"
gh release create "$VERSION" \
--notes-file ".changes/$VERSION.md" \
--title "$VERSION"
mcpb-pack:
runs-on: ubuntu-latest
needs: [create-release-tag, create-github-release]
permissions:
contents: write # required to upload release assets
env:
MCPB_PACKAGE_NAME: dbt-mcp.mcpb
# MCPB_CERT: ${{ secrets.MCPB_CERT }}
# MCPB_KEY: ${{ secrets.MCPB_KEY }}
steps:
- name: Checkout code
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # actions/checkout@v4
with:
ref: ${{ needs.create-release-tag.outputs.changie-latest }}
fetch-tags: true
- name: Setup mcpb
uses: ./.github/actions/setup-mcpb
- name: Setup python
uses: ./.github/actions/setup-python
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda
with:
version: 10
- name: Install go-task
run: sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin
- name: Pack mcpb package
run: task mcpb:pack
# Tested locally, 01/07/26 with valid MCPB_CERT and MCPB_KEY pair
# but `mcpb verify` failed due to known mcpb bug:
# https://github.com/modelcontextprotocol/mcpb/issues/21
# - name: Sign and verify bundle
# run: task mcpb:sign-and-verify
- name: Upload mcpb package to release
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2
with:
tag_name: ${{ needs.create-release-tag.outputs.changie-latest }}
files: ${{ env.MCPB_PACKAGE_NAME }}