Skip to content

Commit ab8ab59

Browse files
authored
ci: add automatic release (#30)
* ci: add GitHub Actions Signed-off-by: Zxilly <[email protected]> * ci: remove duplicate file Signed-off-by: Zxilly <[email protected]> * ci: remove pypy Signed-off-by: Zxilly <[email protected]>
1 parent d54f9d4 commit ab8ab59

File tree

4 files changed

+110
-59
lines changed

4 files changed

+110
-59
lines changed

.coveragerc

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[run]
2+
include = flask_authz/*

.github/workflows/build.yml

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: build
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
test:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
python-version: [ 3.6, 3.7, 3.8, 3.9 ]
16+
os: [ ubuntu-18.04, macOS-latest, windows-latest ]
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v2
21+
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v2
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
27+
- name: Install dependencies
28+
run: |
29+
pip install -r requirements.txt
30+
pip install -r dev_requirements.txt --upgrade
31+
pip install coveralls
32+
33+
- name: Run tests
34+
run: pytest --cov flask_authz
35+
36+
- name: Upload coverage data to coveralls.io
37+
run: coveralls --service=github
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
COVERALLS_FLAG_NAME: ${{ matrix.os }} - ${{ matrix.python-version }}
41+
COVERALLS_PARALLEL: true
42+
43+
coveralls:
44+
name: Indicate completion to coveralls.io
45+
needs: test
46+
runs-on: ubuntu-latest
47+
container: python:3-slim
48+
steps:
49+
- name: Finished
50+
run: |
51+
pip3 install --upgrade coveralls
52+
coveralls --finish
53+
env:
54+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55+
56+
release:
57+
name: Release
58+
runs-on: ubuntu-latest
59+
needs: [ test, coveralls ]
60+
steps:
61+
- name: Checkout
62+
uses: actions/checkout@v2
63+
with:
64+
fetch-depth: 0
65+
66+
- name: Setup Node.js
67+
uses: actions/setup-node@v1
68+
69+
- name: Setup
70+
run: npm install -g semantic-release @semantic-release/github @semantic-release/changelog @semantic-release/commit-analyzer @semantic-release/git @semantic-release/release-notes-generator semantic-release-pypi
71+
72+
- name: Set up python
73+
uses: actions/setup-python@v2
74+
with:
75+
python-version: 3.8
76+
77+
- name: Install setuptools
78+
run: python -m pip install --upgrade setuptools wheel twine
79+
80+
- name: Release
81+
if: github.event_name == 'push'
82+
env:
83+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
84+
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
85+
run: npx semantic-release

.github/workflows/release.yml

-59
This file was deleted.

.releaserc.json

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"branches": "master",
3+
"plugins": [
4+
"@semantic-release/commit-analyzer",
5+
"@semantic-release/release-notes-generator",
6+
"semantic-release-pypi",
7+
"@semantic-release/github",
8+
[
9+
"@semantic-release/changelog",
10+
{
11+
"changelogFile": "CHANGELOG.md",
12+
"changelogTitle": "# Semantic Versioning Changelog"
13+
}
14+
],
15+
[
16+
"@semantic-release/git",
17+
{
18+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}",
19+
"assets": ["CHANGELOG.md", "setup.py", "setup.cfg"]
20+
}
21+
]
22+
]
23+
}

0 commit comments

Comments
 (0)