Repository navigation
120 lines (103 loc) · 3.54 KB
/
Copy pathrelease.yml
File metadata and controls
120 lines (103 loc) · 3.54 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
name: Release
on:
push:
tags:
- "v*"
workflow_dispatch:
# Manual dispatch runs validation only. GitHub Release publication is gated
# to tag-triggered runs by the github-release job condition below.
permissions:
contents: read
jobs:
validate:
name: Validate Release Candidate
runs-on: ubuntu-latest
timeout-minutes: 35
# Release validation runs the release-specific frontend and backend checks,
# including Postgres and Redis-backed tests. It is not the complete PR CI
# matrix: browser acceptance and the golden benchmark remain in ci.yml.
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_USER: partha
POSTGRES_PASSWORD: partha
POSTGRES_DB: partha_test
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U partha -d partha_test"
--health-interval 5s
--health-timeout 5s
--health-retries 10
redis:
image: redis:7-alpine
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 5s
--health-timeout 5s
--health-retries 10
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: apps/frontend/package-lock.json
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
cache: pip
- name: Install frontend dependencies
run: npm ci --prefix apps/frontend
# Pinned lockfile install, matching every other CI job (ci.yml) --
# `pip install -e "apps/backend[test]"` would instead resolve
# pyproject.toml's loose ranges live from PyPI, so a release could be
# validated against completely different, untested dependency versions
# than what PR CI actually tested.
- name: Install backend dependencies
run: |
python -m pip install -r apps/backend/requirements-dev.txt
python -m pip install -e apps/backend --no-deps
- name: Frontend dependency audit
run: |
node --test scripts/dependency-audit.test.mjs
node scripts/dependency-audit.mjs
- name: Lint frontend
run: npm --prefix apps/frontend run lint
- name: Check generated frontend API contract
run: npm --prefix apps/frontend run generate:api-contract -- --check
- name: Build frontend
run: npm --prefix apps/frontend run build
- name: Backend static analysis
working-directory: apps/backend
run: |
ruff check app
ruff format --check app
mypy app
- name: Validate capability registry and docs/CAPABILITIES.md
run: python scripts/check-capabilities.py
- name: Test backend
working-directory: apps/backend
env:
PARTHA_TEST_PG_URL: postgresql+psycopg://partha:partha@localhost:5432/partha_test
PARTHA_TEST_REDIS_URL: redis://localhost:6379/0
run: python -m pytest
github-release:
name: Publish GitHub Release
needs: validate
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: write
steps:
- name: Create release notes
env:
GH_TOKEN: ${{ github.token }}
run: gh release create "${GITHUB_REF_NAME}" --repo "${GITHUB_REPOSITORY}" --generate-notes