-
Notifications
You must be signed in to change notification settings - Fork 9
87 lines (73 loc) · 2.15 KB
/
release.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Create release
on:
workflow_dispatch:
push:
branches:
- master
jobs:
changes:
name: "Create changelog and tag"
runs-on: ubuntu-latest
outputs:
skipped: ${{ steps.changelog.outputs.skipped }}
clean_changelog: ${{ steps.changelog.outputs.clean_changelog }}
tag: ${{ steps.changelog.outputs.tag }}
steps:
- name: checkout
uses: actions/checkout@v2
id: checkout
- name: Conventional Changelog Action
id: changelog
uses: TriPSs/conventional-changelog-action@v3
with:
github-token: ${{ secrets.github_token }}
output-file: "false"
skip-version-file: "true"
skip-commit: "true"
release:
name: "Create release"
needs: changes
if: ${{ needs.changes.outputs.skipped == 'false' }}
runs-on: ubuntu-latest
steps:
- name: Create Release
id: release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
with:
tag_name: ${{ needs.changes.outputs.tag }}
release_name: ${{ needs.changes.outputs.tag }}
body: ${{ needs.changes.outputs.clean_changelog }}
publish:
name: "Publish at PyPi"
needs: changes
if: ${{ needs.changes.outputs.skipped == 'false' }}
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
id: checkout
with:
ref: ${{ needs.changes.outputs.tag }}
- name: Prepare python for publish
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
sudo apt-get install bluez
python -m pip install --upgrade pip
pip install setuptools wheel twine
pip install -r requirements.txt
- name: Set version
env:
VERSION: ${{ needs.changes.outputs.tag }}
run: sed --in-place -e "s/%%%VERSION%%%/${VERSION##v}/" setup.py
- name: Build
run: python setup.py sdist bdist_wheel
- name: Publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: twine upload dist/*