-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (69 loc) · 2.33 KB
/
ci.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
name: ci
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python 3.7
uses: actions/setup-python@v1
with:
python-version: '3.7'
- name: Install dependencies
run: make deps-test
- name: Lint
run: make lint
- name: Run tests
run: make test
publish:
if: github.ref == 'refs/heads/master'
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python 3.7
uses: actions/setup-python@v1
with:
python-version: '3.7'
- name: Install packaging dependencies
run: make deps-dist
- id: package
name: Build packages
run: |
make dist-only
make version-github-action
- name: Echo package version
run: |
echo 'package version: ${{ steps.package.outputs.package_version }}'
echo 'git revision: ${{ steps.package.outputs.git_revision }}'
- id: github_release
name: Create GitHub release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.package.outputs.package_version }}
release_name: Release v${{ steps.package.outputs.package_version }}
- name: Publish source distribution to Github
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.github_release.outputs.upload_url }}
asset_path: dist/cfn-review-bot-${{ steps.package.outputs.package_version }}.tar.gz
asset_name: cfn-review-bot-${{ steps.package.outputs.package_version }}.tar.gz
asset_content_type: application/gzip
- name: Publish wheel to Github
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.github_release.outputs.upload_url }}
asset_path: dist/cfn_review_bot-${{ steps.package.outputs.package_version }}-py3-none-any.whl
asset_name: cfn_review_bot-${{ steps.package.outputs.package_version }}-py3-none-any.whl
asset_content_type: application/zip
- name: Publish packages to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: make release-only