-
Notifications
You must be signed in to change notification settings - Fork 15
59 lines (49 loc) · 1.99 KB
/
build-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
name: CD - Build and release packages
on:
push:
branches: [main]
jobs:
release-please:
name: Release Please
runs-on: ubuntu-latest
outputs:
released: ${{ steps.release.outputs.release_created }}
tag: ${{ steps.release.outputs.tag_name }}
steps:
- uses: GoogleCloudPlatform/release-please-action@v2
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: simple
default-branch: main
changelog-types: '[{"type":"feat","section":"Features"},{"type":"fix","section":"Bug Fixes"},{"type":"perf","section":"Performance Improvements"},{"type":"deps","section":"Dependencies"},{"type":"revert","section":"Reverts"},{"type":"docs","section":"Documentation"},{"type":"style","section":"Styles","hidden":true},{"type":"chore","section":"Miscellaneous Chores","hidden":true},{"type":"refactor","section":"Code Refactoring","hidden":true},{"type":"test","section":"Tests","hidden":true},{"type":"build","section":"Build System","hidden":true},{"type":"ci","section":"Continuous Integration","hidden":true}]'
build:
runs-on: ubuntu-latest
needs: release-please
if: ${{ needs.release-please.outputs.released }}
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install wheel setuptools
- name: Build tar.gz
run: python3 setup.py sdist
- name: Build wheel
run: python3 setup.py bdist_wheel
- name: Upload tar.gz and wheel
uses: svenstaro/upload-release-action@v2
with:
file: dist/*
file_glob: true
tag: ${{ needs.release-please.outputs.tag }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}