Skip to content

Commit 37375ba

Browse files
authored
feat: Replace Travis CI with GitHub Actions CI and add semantic-release (#3)
1 parent 4a79a24 commit 37375ba

File tree

9 files changed

+162
-60
lines changed

9 files changed

+162
-60
lines changed

.coveragerc

Lines changed: 0 additions & 2 deletions
This file was deleted.

.github/semantic.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Always validate the PR title AND all the commits
2+
titleAndCommits: true

.github/workflows/build.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: build
2+
on:
3+
push:
4+
branches: [master]
5+
pull_request:
6+
branches: [master]
7+
jobs:
8+
tests:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
python-version: ["3.10", "3.11", "3.12"]
14+
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v2
18+
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v2
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Upgrade install tools
25+
run: python -m pip install --upgrade setuptools wheel
26+
27+
- name: Install dependencies
28+
run: |
29+
pip install -r requirements.txt
30+
31+
- name: Run tests
32+
run: |
33+
python -m unittest discover -s tests -t tests
34+
35+
coveralls:
36+
runs-on: ubuntu-latest
37+
steps:
38+
- name: Checkout
39+
uses: actions/checkout@v2
40+
41+
- name: Set up Python
42+
uses: actions/setup-python@v2
43+
with:
44+
python-version: 3.11
45+
46+
- name: Install dependencies
47+
run: |
48+
pip install -r requirements.txt
49+
pip install coveralls
50+
pip install coverage
51+
52+
- name: Run tests
53+
run: coverage run -m unittest discover -s tests -t tests
54+
55+
- name: Upload coverage data to coveralls.io
56+
run: coveralls --service=github
57+
env:
58+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59+
60+
release:
61+
name: Release
62+
runs-on: ubuntu-latest
63+
needs: [ tests, coveralls ]
64+
steps:
65+
- name: Checkout
66+
uses: actions/checkout@v2
67+
with:
68+
fetch-depth: 0
69+
70+
- name: Setup Node.js
71+
uses: actions/setup-node@v1
72+
with:
73+
node-version: '20'
74+
75+
- name: Setup
76+
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
77+
78+
- name: Set up python
79+
uses: actions/setup-python@v2
80+
with:
81+
python-version: 3.11
82+
83+
- name: Install setuptools
84+
run: python -m pip install --upgrade setuptools wheel twine
85+
86+
- name: Release
87+
env:
88+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
89+
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
90+
run: npx semantic-release

.releaserc.json

Lines changed: 23 additions & 0 deletions
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", "pyproject.toml"]
20+
}
21+
]
22+
]
23+
}

.travis.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
SQLObject Adapter for PyCasbin
22
====
3-
4-
[![Build Status](https://www.travis-ci.org/pycasbin/sqlobject-adapter.svg?branch=master)](https://www.travis-ci.org/pycasbin/sqlobject-adapter)
3+
[![GitHub Action](https://github.com/pycasbin/sqlobject-adapter/workflows/build/badge.svg?branch=master)](https://github.com/pycasbin/sqlobject-adapter/actions)
54
[![Coverage Status](https://coveralls.io/repos/github/pycasbin/sqlobject-adapter/badge.svg)](https://coveralls.io/github/pycasbin/sqlobject-adapter)
65
[![Version](https://img.shields.io/pypi/v/casbin_sqlobject_adapter.svg)](https://pypi.org/project/casbin_sqlobject_adapter/)
76
[![PyPI - Wheel](https://img.shields.io/pypi/wheel/casbin_sqlobject_adapter.svg)](https://pypi.org/project/casbin_sqlobject_adapter/)

package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"devDependencies": {
3+
"@semantic-release/changelog": "^6.0.3",
4+
"@semantic-release/git": "^10.0.1",
5+
"semantic-release": "^22.0.5",
6+
"semantic-release-pypi": "^3.0.0"
7+
}
8+
}

pyproject.toml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
[project]
2+
name = "casbin_sqlobject_adapter"
3+
version = "0.1.1"
4+
authors = [
5+
{name = "TechLee", email = "techlee@qq.com"},
6+
]
7+
description = "SQLObject Adapter for PyCasbin"
8+
keywords=["casbin", "SQLObject", "casbin-adapter", "rbac", "access control", "abac", "acl", "permission"]
9+
readme = "README.md"
10+
dynamic = ["dependencies"]
11+
requires-python = ">=3.4"
12+
license = {text = "Apache 2.0"}
13+
classifiers = [
14+
"Programming Language :: Python :: 3.4",
15+
"Programming Language :: Python :: 3.5",
16+
"Programming Language :: Python :: 3.6",
17+
"Programming Language :: Python :: 3.7",
18+
"Programming Language :: Python :: 3.8",
19+
"Programming Language :: Python :: 3.9",
20+
"Programming Language :: Python :: 3.10",
21+
"Programming Language :: Python :: 3.11",
22+
"Programming Language :: Python :: 3.12",
23+
"License :: OSI Approved :: Apache Software License",
24+
"Operating System :: OS Independent",
25+
]
26+
27+
[project.urls]
28+
"Home-page" = "https://github.com/pycasbin/sqlobject-adapter"
29+
30+
[build-system]
31+
requires = ["setuptools"]
32+
build-backend = "setuptools.build_meta"
33+
34+
[tool.setuptools.packages.find]
35+
exclude = ["tests", "tests.*"]
36+
37+
[tool.setuptools.dynamic]
38+
dependencies = {file = ["requirements.txt"]}

setup.py

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)