-
Notifications
You must be signed in to change notification settings - Fork 7
42 lines (39 loc) · 1.26 KB
/
publish.yml
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
name: Publish
on:
release:
types: [created]
jobs:
publish:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Version
run: |
version=`git describe --abbrev=0 --tags` &&
sed -i s/\[0-9]\.\[0-9]\.\[0-9]/$version/ mailosaur/mailosaur_client.py &&
sed -i s/\[0-9]\.\[0-9]\.\[0-9]/$version/ mailosaur/version.py &&
sed -i s/\[0-9]\.\[0-9]\.\[0-9]/$version/ setup.py
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
- name: Notify on Failure
uses: skitionek/notify-microsoft-teams@master
if: ${{ failure() }}
with:
webhook_url: ${{ secrets.TEAMS_BUILDS_WEBHOOK }}
needs: ${{ toJson(needs) }}
job: ${{ toJson(job) }}
overwrite: "{ title: `${workflow} failed for ${repository.name}` }"