-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (66 loc) · 2.38 KB
/
Copy pathrelease.yml
File metadata and controls
77 lines (66 loc) · 2.38 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
name: Release
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
tag:
description: "Existing release tag to publish"
required: true
type: string
permissions:
contents: write
id-token: write
attestations: write
jobs:
verify-and-release:
name: Verify and release
runs-on: ubuntu-latest
timeout-minutes: 20
env:
RELEASE_TAG: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref_name }}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
ref: ${{ env.RELEASE_TAG }}
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
- name: Install project
run: python -m pip install --disable-pip-version-check -e ".[dev]"
- name: Verify release candidate
run: |
python -m ruff format --check .
python -m ruff check .
python -m mypy
python -m pytest
python scripts/check_traceability.py
python scripts/validate_schemas.py
answerable doctor
answerable demo causal --output /tmp/answerable-demo-causal
answerable demo grain --output /tmp/answerable-demo-grain
answerable demo maturity --output /tmp/answerable-demo-maturity
python -c "from answerable.interfaces.mcp_stdio import build_server; build_server(); print('source MCP OK')"
- name: Build distributions
run: python -m build
- name: Verify wheel installation and MCP extra
run: |
python -m venv /tmp/answerable-wheel
WHEEL="$(ls dist/*.whl)"
/tmp/answerable-wheel/bin/python -m pip install "${WHEEL}[mcp]"
/tmp/answerable-wheel/bin/answerable doctor
/tmp/answerable-wheel/bin/answerable demo causal --output /tmp/answerable-wheel-demo
/tmp/answerable-wheel/bin/python -c "from answerable.interfaces.mcp_stdio import build_server; build_server(); print('wheel MCP OK')"
- name: Attest distributions
uses: actions/attest-build-provenance@v2
with:
subject-path: "dist/*"
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
- name: Publish GitHub release
env:
GH_TOKEN: ${{ github.token }}
run: gh release create "$RELEASE_TAG" dist/* --generate-notes --verify-tag