Repository navigation
57 lines (49 loc) · 1.67 KB
/
Copy pathdeploy.yml
File metadata and controls
57 lines (49 loc) · 1.67 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
name: Deploy SDK
on:
release:
types:
- published
jobs:
deploy:
name: Deploy SDK to PYPI
runs-on: ubuntu-latest
steps:
- name: Set Release Version
run: echo "RELEASE_VERSION=${TAG#v}" >> $GITHUB_ENV
env:
TAG: ${{ github.event.release.tag_name }}
- name: Check Release Tag Format
run: |
re=[0-9]+\.[0-9]+\.[0-9]+
if ! [[ $RELEASE_VERSION =~ $re ]]; then
echo 'Tag does not match expected regex pattern for releases (v[0-9]+\.[0-9]+\.[0-9]+)'
echo $RELEASE_VERSION
echo 'Please update your tag to match the expected regex pattern'
exit 1
fi
- name: Checkout
uses: actions/checkout@v7
- name: Generate SDK with Updated Version
run: bash generate.sh --additional-properties=packageVersion=$RELEASE_VERSION
- name: Install Packages and Test
run: |
pip install -r requirements.txt
pip install -r test-requirements.txt
npm install -g @stoplight/prism-cli
prism mock ./bandwidth.yml & pytest -v ./test/unit
shell: bash
- name: Deploy to PYPI
run: |
pip install packaging==24.2
pip install twine
pip install wheel
python setup.py sdist bdist_wheel
twine upload dist/* -u __token__ -p $PYPI_API_KEY
env:
PYPI_API_KEY: ${{ secrets.PYPI_API_KEY }}
- uses: Bandwidth/build-notify-slack-action@v2
if: always()
with:
job-status: ${{ job.status }}
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
slack-channel: ${{ secrets.SLACK_CHANNEL }}