Skip to content

Commit 1a2bef8

Browse files
update CI
update CI, setup code-cov, pylint and build packages
1 parent fe8a511 commit 1a2bef8

File tree

4 files changed

+95
-12
lines changed

4 files changed

+95
-12
lines changed
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: build and release openstackquery package
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Version to release'
8+
required: true
9+
changelog:
10+
description: 'Release changelog description'
11+
required: false
12+
13+
jobs:
14+
release:
15+
runs-on: ubuntu-latest
16+
17+
if: github.ref == 'refs/heads/main'
18+
19+
strategy:
20+
matrix:
21+
python-version: ['3.8', '3.x']
22+
23+
steps:
24+
- name: Checkout code
25+
uses: actions/checkout@v4
26+
27+
- name: Set up Python ${{ matrix.python-version }}
28+
uses: actions/setup-python@v4
29+
with:
30+
python-version: ${{ matrix.python-version }}
31+
32+
- name: Update version in setup.py
33+
run: |
34+
sed -i "s/version=.*,/version='${{ github.event.inputs.version }}',/" setup.py
35+
36+
- name: Install dependencies
37+
run: |
38+
python -m pip install --upgrade pip
39+
pip install setuptools wheel build
40+
41+
- name: Build package
42+
run: python -m build
43+
44+
- name: Upload artifacts
45+
uses: actions/upload-artifact@v3
46+
with:
47+
name: dist-${{ matrix.python-version }}
48+
path: dist/
49+
50+
publish:
51+
needs: release
52+
runs-on: ubuntu-latest
53+
54+
steps:
55+
- name: Checkout code
56+
uses: actions/checkout@v4
57+
58+
- name: Download all artifacts
59+
uses: actions/download-artifact@v3
60+
with:
61+
path: dist
62+
63+
- name: Generate Changelog
64+
id: changelog
65+
run: |
66+
if [ -z "${{ github.event.inputs.changelog }}" ]; then
67+
echo "changelog=Release version ${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
68+
else
69+
echo "changelog=${{ github.event.inputs.changelog }}" >> $GITHUB_OUTPUT
70+
fi
71+
72+
- name: Create Git Tag
73+
run: |
74+
git config user.name github-actions
75+
git config user.email github-actions@github.com
76+
git add version.txt
77+
git commit -m "Bump version to ${{ github.event.inputs.version }}"
78+
git tag v${{ github.event.inputs.version }}
79+
git push origin main
80+
git push origin v${{ github.event.inputs.version }}
81+
82+
- name: Create GitHub Release
83+
uses: softprops/action-gh-release@v1
84+
with:
85+
tag_name: v${{ github.event.inputs.version }}
86+
body: ${{ steps.changelog.outputs.changelog }}
87+
files: |
88+
dist/**/*.whl
89+
dist/**/*.tar.gz
90+
env:
91+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/pylint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ubuntu-latest
88
strategy:
99
matrix:
10-
python-version: ["3.8", "3.9", "3.10"]
10+
python-version: ["3.8", "3.x"]
1111
steps:
1212
- uses: actions/checkout@v4
1313
- name: Set up Python ${{ matrix.python-version }}

.github/workflows/unittest.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,7 @@ jobs:
2222
- name: Run Tests
2323
run: cd $GITHUB_WORKSPACE && ./run_tests.sh
2424

25-
- name: Run pytest with codecov
25+
- name: Run pytest
2626
run: |
2727
pip install -r requirements.txt
28-
pytest .
29-
30-
- name: Submit Coverage
31-
uses: codecov/codecov-action@v4
32-
with:
33-
fail_ci_if_error: true
34-
token: ${{secrets.CODECOV_TOKEN}}
28+
cd $GITHUB_WORKSPACE && pytest .

setup.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
from setuptools import setup, find_packages
22

3-
VERSION = "0.2.1"
43
DESCRIPTION = "python package for openstack query library"
5-
64
LONG_DESCRIPTION = (
75
"""Python package for running complex queries on OpenStack Resources"""
86
)
97

108
setup(
119
name="openstackquery",
12-
version=VERSION,
10+
version="0.1.0",
1311
author="Anish Mudaraddi",
1412
author_email="<anish.mudaraddi@stfc.ac.uk>",
1513
description=DESCRIPTION,

0 commit comments

Comments
 (0)