Skip to content

Commit 65b6959

Browse files
committed
feat: add workflow for testing and release
Signed-off-by: Pamy, Carme <pamy.carme@gmail.com>
1 parent 8080462 commit 65b6959

7 files changed

Lines changed: 94 additions & 11 deletions

File tree

.github/workflows/build.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: build
2+
on:
3+
push:
4+
branches: [main]
5+
pull_request:
6+
branches: [main]
7+
8+
jobs:
9+
test:
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
python-version: [3.7, 3.8, 3.9]
15+
os: [ubuntu-18.04]
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v2
20+
21+
- name: Set up Python ${{ matrix.python-version }}
22+
uses: actions/setup-python@v2
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
26+
- name: Install dependencies
27+
run: |
28+
pip install -r requirements.txt
29+
pip install -r requirements_dev.txt
30+
- name: Run tests
31+
run: tox
32+
33+
release:
34+
name: Release
35+
runs-on: ubuntu-latest
36+
needs: [ test ]
37+
steps:
38+
- name: Checkout
39+
uses: actions/checkout@v2
40+
with:
41+
fetch-depth: 0
42+
43+
- name: Setup Node.js
44+
uses: actions/setup-node@v2
45+
with:
46+
node-version: '16'
47+
48+
- name: Setup
49+
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
50+
51+
- name: Set up python
52+
uses: actions/setup-python@v2
53+
with:
54+
python-version: 3.8
55+
56+
- name: Install setuptools
57+
run: python -m pip install --upgrade setuptools wheel twine
58+
59+
- name: Release
60+
env:
61+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62+
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
63+
run: npx semantic-release

.releaserc.json

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

CHANGELOG.md

Whitespace-only changes.

requirements_dev.in

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,4 @@ pytest
22
pytest-cov
33
tox
44
black
5-
flake8
6-
bumpversion
7-
pre-commit
8-
sphinx
9-
sphinx_rtd_theme
10-
pip-tools
115
pytest-mock

requirements_dev.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pytest
2+
pytest-cov
3+
tox
4+
black
5+
pytest-mock

setup.cfg

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[bdist_wheel]
2-
universal=1
2+
universal = 1
33

44
[metadata]
5-
description-file=README.md
5+
description-file = README.md
6+
version = 0.1.0

setup.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
from codecs import open
33
from os import path
44

5-
__version__ = "0.1.0"
65

76
here = path.abspath(path.dirname(__file__))
87

@@ -21,12 +20,11 @@
2120

2221
setup(
2322
name="stackconfig",
24-
version=__version__,
2523
description="Render, merge and validate docker_compose files for deploying a stack",
2624
long_description=long_description,
2725
long_description_content_type="text/markdown",
2826
url="https://github.com/Sciencelogic/stackconfig",
29-
download_url="https://github.com/Sciencelogic/stackconfig/tarball/" + __version__,
27+
download_url="https://github.com/Sciencelogic/stackconfig/tarball/",
3028
license="BSD",
3129
classifiers=[
3230
"Development Status :: 3 - Alpha",

0 commit comments

Comments
 (0)