forked from ekeih/libtado
-
Notifications
You must be signed in to change notification settings - Fork 9
101 lines (94 loc) · 2.97 KB
/
release-master.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
---
name: Release Management
on:
push:
branches:
- master
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Semantic Release Config
run: |
echo '{
"tagFormat":"${version}",
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"@semantic-release/github"
]
}
'> .releaserc
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v2
id: semantic
with:
branches: 'master'
semantic_version: 19.0.2
extra_plugins: |
@semantic-release/commit-analyzer@9.0.2
@semantic-release/release-notes-generator@10.0.3
@semantic-release/changelog@6.0.1
@semantic-release/github@8.0.2
dry_run: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: set release_version
id: set_release_version
uses: noobly314/share-data@v1
with:
share-id: release_version
mode: set
key: version
value: ${{ steps.semantic.outputs.new_release_version }}
- name: set release_published
id: set_release_published
uses: noobly314/share-data@v1
with:
share-id: release_published
mode: set
key: version
value: ${{ steps.semantic.outputs.new_release_published }}
deploy:
needs: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.7'
- name: get release_version
id: release_version
uses: noobly314/share-data@v1
with:
share-id: release_version
mode: get
key: version
- name: get release_published
id: release_published
uses: noobly314/share-data@v1
with:
share-id: release_published
mode: get
key: version
- name: Update package version
run: |
sed -i "s/^\( *version=\).*/\1'${{ steps.release_version.outputs.data }}',/g" setup.py
sed -i 's/^\(^version = \).*/\1"${{ steps.release_version.outputs.data }}",/g' pyproject.toml
if: steps.release_published.outputs.data == 'true'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
if: steps.release_published.outputs.data == 'true'
- name: Build and publish
env:
TWINE_USERNAME: "__token__"
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
if: steps.release_published.outputs.data == 'true'