@@ -9,7 +9,6 @@ permissions:
99 contents : write
1010 issues : write
1111 pull-requests : write
12- id-token : write # Required for PyPI trusted publishing
1312
1413jobs :
1514 test :
2019 needs : test
2120 runs-on : ubuntu-latest
2221 environment :
23- name : pypi
24- url : https://pypi.org/p/ mcpm
22+ name : melio-s3
23+ url : https://aitools.eilat.melioservices.com/ mcpm/servers.json
2524
2625 steps :
2726 - name : Checkout
@@ -65,10 +64,29 @@ jobs:
6564 enable-cache : true
6665 cache-dependency-glob : " pyproject.toml"
6766
68- - name : Build
67+ - name : Run preparation script
6968 if : steps.semantic.outputs.new_release_published == 'true'
70- run : uv build
69+ env :
70+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
71+ run : |
72+ chmod +x ./scripts/prepare.sh
73+ source .venv/bin/activate
74+ ./scripts/prepare.sh ./output
75+
76+ - name : Configure AWS credentials
77+ if : steps.semantic.outputs.new_release_published == 'true'
78+ uses : aws-actions/configure-aws-credentials@v4
79+ with :
80+ aws-access-key-id : ${{ secrets.AWS_ACCESS_KEY_ID }}
81+ aws-secret-access-key : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
82+ aws-region : us-east-1
83+
84+ - name : Upload servers.json to S3
85+ if : steps.semantic.outputs.new_release_published == 'true'
86+ run : |
87+ aws s3 cp ./output/api/servers.json s3://aitools.eilat.melioservices.com/mcpm/servers.json --content-type "application/json"
7188
72- - name : Publish distribution to PyPI
89+ - name : Invalidate CloudFront cache
7390 if : steps.semantic.outputs.new_release_published == 'true'
74- uses : pypa/gh-action-pypi-publish@release/v1
91+ run : |
92+ aws cloudfront create-invalidation --distribution-id E3VSH7IG39WRB6 --paths "/mcpm/servers.json"
0 commit comments