Skip to content

Commit f677143

Browse files
committed
CI release
1 parent 9fc1fbf commit f677143

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

.github/workflows/release.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
15+
- name: Prepare
16+
id: prepare
17+
run: |
18+
git fetch --prune --unshallow --tags -f
19+
20+
VERSION=$(git tag --points-at HEAD)
21+
VERSION=${VERSION//v}
22+
23+
echo "## :bookmark_tabs: Changes" >>"CHANGELOG.md"
24+
git log --pretty=format:"- %s%n" $(git describe --abbrev=0 --tags $(git describe --tags --abbrev=0)^)...$(git describe --tags --abbrev=0) >>"CHANGELOG.md"
25+
26+
echo ::set-output name=version::${VERSION}
27+
28+
- name: Publish a Python distribution to PyPI
29+
uses: pypa/gh-action-pypi-publish@release/v1
30+
with:
31+
user: __token__
32+
password: ${{ secrets.PYPI_API_TOKEN }}
33+
34+
- name: Create Release
35+
uses: actions/create-release@v1
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
with:
39+
tag_name: ${{ github.ref }}
40+
release_name: ${{ steps.prepare.outputs.version }}
41+
body_path: CHANGELOG.md
42+
draft: false
43+
prerelease: false

.github/workflows/build.yaml renamed to .github/workflows/validate.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,8 @@ jobs:
4040

4141
- name: Perform CodeQL Analysis
4242
uses: github/codeql-action/analyze@v1
43+
44+
- name: Test
45+
run: |
46+
pip install pytest pytest-cov
47+
pytest tests/ --doctest-modules --cov=MCP2221 --cov-report term-missing

0 commit comments

Comments
 (0)