-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (55 loc) · 1.63 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
name: ci
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
- 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
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Setup Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
- 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 }}'
- uses: softprops/action-gh-release@v2
with:
name: Release v${{ steps.package.outputs.package_version }}
tag_name: v${{ steps.package.outputs.package_version }}
prerelease: true
files: |
dist/cfn-review-bot-${{ steps.package.outputs.package_version }}.tar.gz
dist/cfn_review_bot-${{ steps.package.outputs.package_version }}-py3-none-any.whl
fail_on_unmatched_files: true
generate_release_notes: true
- name: Publish packages to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: make release-only