Skip to content

Commit 245433b

Browse files
committed
Update publish workflow to update manifest on release
1 parent 978fdac commit 245433b

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

.github/workflows/publish-python-sdk.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,39 @@ jobs:
4444

4545
- name: Publish to PyPI
4646
uses: pypa/gh-action-pypi-publish@release/v1
47+
48+
# Publish instrumentation manifest to GitHub Pages
49+
# This makes the manifest available at: https://use-tusk.github.io/drift-python-sdk/instrumentation-manifest.json
50+
publish-manifest:
51+
needs: [publish]
52+
if: github.event_name == 'release' # Only run on actual releases, not workflow_dispatch
53+
runs-on: ubuntu-latest
54+
permissions:
55+
contents: write
56+
steps:
57+
- name: Checkout source (tagged commit)
58+
uses: actions/checkout@v4
59+
60+
- name: Setup Python
61+
uses: actions/setup-python@v5
62+
with:
63+
python-version: "3.12"
64+
65+
- name: Generate manifest
66+
run: |
67+
python scripts/generate_manifest.py --output /tmp/instrumentation-manifest.json
68+
cat /tmp/instrumentation-manifest.json
69+
70+
- name: Checkout gh-pages branch
71+
uses: actions/checkout@v4
72+
with:
73+
ref: gh-pages
74+
75+
- name: Update manifest and commit
76+
run: |
77+
cp /tmp/instrumentation-manifest.json ./instrumentation-manifest.json
78+
git config user.name "github-actions[bot]"
79+
git config user.email "github-actions[bot]@users.noreply.github.com"
80+
git add instrumentation-manifest.json
81+
git commit -m "Update manifest for ${{ github.event.release.tag_name }}" || echo "No changes to commit"
82+
git push origin gh-pages

0 commit comments

Comments
 (0)