File tree Expand file tree Collapse file tree 3 files changed +63
-50
lines changed
Expand file tree Collapse file tree 3 files changed +63
-50
lines changed Original file line number Diff line number Diff line change 3939 with :
4040 environment : prod
4141 secrets : inherit
42-
43- publish_clients :
44- name : Publish API clients
45- needs : [deploy_prod]
46- uses : ./.github/workflows/publish-clients.reusable.yml
47- with :
48- environment : prod
49- secrets :
50- PYPI_TOKEN : ${{ secrets.PYPI }}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ name : Publish API clients
2+
3+ on :
4+ workflow_run :
5+ workflows : ["Deploy"]
6+ types :
7+ - completed
8+ branches :
9+ - main
10+
11+
12+ jobs :
13+ publish :
14+ name : Publish API clients
15+ runs-on : ubuntu-latest
16+
17+ steps :
18+ - name : Checkout repo
19+ uses : actions/checkout@v4
20+
21+ - name : Set up Python
22+ uses : actions/setup-python@v5
23+ with :
24+ python-version : ' 3.13'
25+
26+ - name : Install uv
27+ uses : astral-sh/setup-uv@v3
28+
29+ - name : Generate API clients
30+ run : |
31+ ./scripts/generate-clients.sh
32+
33+ - name : Build full API client
34+ run : |
35+ cd projects/policyengine-api-full/artifacts/clients/python
36+ # Update version
37+ DATE=$(date +%Y%m%d)
38+ RUN_NUMBER="${{ github.run_number }}"
39+ NEW_VERSION="0.${DATE}.${RUN_NUMBER}"
40+ sed -i "s/^version = .*/version = \"${NEW_VERSION}\"/" pyproject.toml
41+ uv build
42+
43+ - name : Build simulation API client
44+ run : |
45+ cd projects/policyengine-api-simulation/artifacts/clients/python
46+ # Update version
47+ DATE=$(date +%Y%m%d)
48+ RUN_NUMBER="${{ github.run_number }}"
49+ NEW_VERSION="0.${DATE}.${RUN_NUMBER}"
50+ sed -i "s/^version = .*/version = \"${NEW_VERSION}\"/" pyproject.toml
51+ uv build
52+
53+ - name : Publish full API client to PyPI
54+ uses : pypa/gh-action-pypi-publish@release/v1
55+ with :
56+ password : ${{ secrets.PYPI }}
57+ packages-dir : projects/policyengine-api-full/artifacts/clients/python/dist/
58+
59+ - name : Publish simulation API client to PyPI
60+ uses : pypa/gh-action-pypi-publish@release/v1
61+ with :
62+ password : ${{ secrets.PYPI }}
63+ packages-dir : projects/policyengine-api-simulation/artifacts/clients/python/dist/
You can’t perform that action at this time.
0 commit comments