-
Notifications
You must be signed in to change notification settings - Fork 25
200 lines (172 loc) · 5.96 KB
/
release.yaml
File metadata and controls
200 lines (172 loc) · 5.96 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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
name: Official Recce Release
on:
push:
tags: 'v*'
permissions:
contents: read
jobs:
build:
name: Build Recce Official Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: "latest"
- name: Setup Node 24
uses: actions/setup-node@v4
with:
node-version: '24'
- uses: pnpm/action-setup@v4
with:
version: 10
- name: Install dependencies
run: |
# Install Python dependencies
uv sync --all-extras --python 3.10
# Install Node dependencies
pushd js
pnpm install --frozen-lockfile
popd
- name: Patch Recce Version
id: patch_version
run: |
# Patch version
echo "${GITHUB_REF:11}" > ./recce/VERSION
echo "Release Version: $(cat recce/VERSION)"
echo "release_version=$(cat recce/VERSION)" >> $GITHUB_OUTPUT
- name: Patch Event API Key
run: |
# Patch Event API Key
sed -i.bak "s/<API_KEY>/${EVENT_API_KEY}/" recce/event/CONFIG
env:
EVENT_API_KEY: ${{ secrets.AMPLITUDE_API_KEY }}
- name: Build Front-end Static Files
run: |
# Build static files
pushd js
pnpm build
popd
env:
AMPLITUDE_API_KEY: ${{ secrets.AMPLITUDE_API_KEY }}
GTM_ID: ${{ secrets.GTM_ID }}
- name: Release to Pypi
run: |
# generate pypirc
echo "$PYPIRC" > $HOME/.pypirc
# build and upload to pypi
uv build
uv run twine upload dist/*
env:
PYPIRC: ${{ secrets.PYPI }}
- name: Mark Sentry Release
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: infuseai
SENTRY_PROJECT: recce
with:
environment: production
ignore_empty: true
ignore_missing: true
version: ${{ steps.patch_version.outputs.release_version }}
- name: Upload version artifact for UI release
uses: actions/upload-artifact@v4
with:
name: recce-release-version
path: recce/VERSION
retention-days: 1
build-recce-cloud:
name: Build Recce Cloud Official Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: "latest"
- name: Install dependencies
run: |
# Install Python dependencies
uv sync --all-extras --python 3.10
- name: Patch Recce Cloud Version
id: patch_version
run: |
# Patch version from tag directly to recce_cloud/recce_cloud/VERSION
echo "${GITHUB_REF:11}" > ./recce_cloud/recce_cloud/VERSION
echo "Release Version: $(cat recce_cloud/recce_cloud/VERSION)"
echo "release_version=$(cat recce_cloud/recce_cloud/VERSION)" >> $GITHUB_OUTPUT
- name: Release to Pypi
run: |
# generate pypirc
echo "$PYPIRC" > $HOME/.pypirc
# build and upload recce-cloud to pypi
uv build --package recce-cloud
uv run twine upload dist/*
env:
PYPIRC: ${{ secrets.PYPI }}
- name: Mark Sentry Release
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: infuseai
SENTRY_PROJECT: recce-cloud
with:
environment: production
ignore_empty: true
ignore_missing: true
version: ${{ steps.patch_version.outputs.release_version }}
trigger-build-recce-instance-launcher-image:
name: Trigger Recce Instance Launcher Image Build
runs-on: ubuntu-latest
permissions:
contents: read
needs: build
steps:
- uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: 2343362 # App ID of Recce Action Bot
private-key: ${{ secrets.RECCE_ACTION_BOT_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- name: Fetch latest release from Recce Cloud Infra repo
id: latest-recce-cloud-release
env:
TOKEN: ${{ steps.app-token.outputs.token }}
ORG: DataRecce
REPO: recce-cloud-infra
run: |
tag=$(curl -sS --fail-with-body \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${TOKEN}" \
https://api.github.com/repos/${ORG}/${REPO}/releases/latest \
| jq -r .tag_name)
if [ -z "$tag" ] || [ "$tag" = "null" ]; then
echo "Error: Failed to fetch latest release tag from ${ORG}/${REPO}"
exit 1
fi
echo "tag_name=$tag" >> "$GITHUB_OUTPUT"
echo "Fetched latest release: $tag"
- name: Trigger Recce Instance Launcher Image Build Workflow
id: dispatch
continue-on-error: true
uses: benc-uk/workflow-dispatch@v1
with:
workflow: 'build-recce-instance-launcher.yml'
repo: 'DataRecce/recce-cloud-infra'
ref: ${{ steps.latest-recce-cloud-release.outputs.tag_name }}
inputs: '{ "environment": "production" }'
token: '${{ steps.app-token.outputs.token }}'
- name: Handle dispatch failure
if: steps.dispatch.outcome == 'failure'
run: |
echo "::warning::Failed to trigger recce-cloud-infra build workflow"
echo "::warning::Please manually trigger the build at: https://github.com/DataRecce/recce-cloud-infra/actions/workflows/build-recce-instance-launcher.yml"
echo "::warning::Use ref: ${{ steps.latest-recce-cloud-release.outputs.tag_name }} and environment: production"