-
Notifications
You must be signed in to change notification settings - Fork 2
97 lines (82 loc) · 2.77 KB
/
release.yml
File metadata and controls
97 lines (82 loc) · 2.77 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
name: Test, Build, Publish
on:
push:
branches: [main]
tags: ["v*"]
pull_request:
branches: [main]
jobs:
# ─── Run tests on every push / PR ────────────────────────────────────────
test:
name: Test (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip install -e ".[dev,scale,visual,mcp]"
- name: Run tests
run: pytest --cov=repomap --cov-report=term-missing
# ─── Build Python wheel + sdist (only on version tags) ───────────────────
build-python:
name: Build Python package
needs: test
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Build wheel and sdist
run: |
pip install build
python -m build
- uses: actions/upload-artifact@v4
with:
name: python-dist
path: dist/
# ─── Publish to PyPI using trusted publishing (no token needed) ──────────
publish-pypi:
name: Publish to PyPI
needs: build-python
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
environment: pypi
permissions:
id-token: write # required for OIDC trusted publishing
steps:
- uses: actions/download-artifact@v4
with:
name: python-dist
path: dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
# ─── Publish npm wrapper to npmjs.com ────────────────────────────────────
publish-npm:
name: Publish to npm
needs: publish-pypi
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
registry-url: "https://registry.npmjs.org"
# Keep the npm package version in sync with the git tag (strips leading 'v')
- name: Sync npm version to git tag
working-directory: npm
run: |
TAG="${GITHUB_REF#refs/tags/v}"
npm version "$TAG" --no-git-tag-version
- name: Publish to npm
working-directory: npm
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}