forked from kdeldycke/mail-deduplicate
-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (60 loc) · 1.93 KB
/
build.yaml
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
---
name: Build
"on":
push:
pull_request:
jobs:
build:
name: Build, check and publish package on release
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2.3.4
- uses: actions/setup-python@v2.2.2
- name: Build package
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade poetry
poetry install
poetry build
- name: Attach packages to workflow run for later inspection and debugging
uses: actions/upload-artifact@v2.2.3
with:
name: mail-deduplicate-python-packages
path: ./dist/*
- name: Validates package metadata
run: |
poetry check
poetry run twine check ./dist/*
poetry run check-wheel-contents ./dist/*.whl
- name: Test publishing
run: |
poetry publish --dry-run --no-interaction
- name: Extract version
id: get_version
run: echo ::set-output name=TAG_VERSION::${GITHUB_REF#refs/tags/v}
- name: Create a release on GitHub
# Only triggers on version tagging.
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: ./dist/*
body: |
🐍 [Available on
PyPi](https://pypi.org/project/mail-deduplicate/${{
steps.get_version.outputs.TAG_VERSION }}/).
Changelog:
* <TODO>
* <TODO>
* <TODO>
- name: Push package to public PyPi repository
# Only triggers on version tagging.
if: startsWith(github.ref, 'refs/tags/v')
uses: pypa/gh-action-pypi-publish@v1.4.2
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
- name: Test post-release version bump
run: |
poetry run bumpversion --verbose patch