Skip to content

Commit 0834788

Browse files
committed
fix(CI): added github actions
Signed-off-by: Sridhar G K <gksridhar09@gmail.com>
1 parent 75279fa commit 0834788

5 files changed

Lines changed: 585 additions & 86 deletions

File tree

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Build & Release
2+
3+
on:
4+
push:
5+
branches: ['**']
6+
pull_request:
7+
branches: ['**']
8+
workflow_dispatch:
9+
# Allow workflow to be triggered manually.
10+
11+
jobs:
12+
build:
13+
name: build-test (python ${{ matrix.python-version }})
14+
runs-on: ubuntu-latest
15+
16+
strategy:
17+
matrix:
18+
python-version: ['3.10', '3.11', '3.12', '3.13']
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
24+
- name: Set up Python ${{ matrix.python-version }}
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: ${{ matrix.python-version }}
28+
cache: 'pip'
29+
30+
- name: Install pandoc
31+
run: |
32+
sudo apt-get update
33+
sudo apt-get install pandoc
34+
pip install pypandoc
35+
36+
- name: Install dependencies
37+
run: pip install 'tox<4' tox-gh-actions
38+
39+
- name: Run tests
40+
run: tox
41+
42+
create-release:
43+
name: semantic-release
44+
if: "github.ref_name == 'master' && github.event_name != 'pull_request'"
45+
needs: build
46+
runs-on: ubuntu-latest
47+
48+
steps:
49+
- name: Checkout repository
50+
uses: actions/checkout@v4
51+
with:
52+
persist-credentials: false
53+
fetch-depth: 0
54+
55+
- name: Setup Node.js
56+
uses: actions/setup-node@v4
57+
with:
58+
node-version: 22
59+
60+
- name: Setup Python
61+
uses: actions/setup-python@v5
62+
with:
63+
python-version: '3.10'
64+
65+
- name: Install Publishing Tools
66+
run: |
67+
pip install bump2version build twine
68+
npm install
69+
70+
- name: Run semantic-release
71+
env:
72+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
73+
run: npx semantic-release
74+
75+
- name: Publish to PyPI
76+
if: success()
77+
env:
78+
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
79+
run: |
80+
python -m build
81+
python -m twine upload dist/* -u __token__ -p $PYPI_TOKEN

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Build Status](https://travis-ci.com/IBM/networking-python-sdk.svg?branch=master)](https://travis-ci.com/IBM/networking-python-sdk)
1+
[![Build Status](https://github.com/IBM/networking-python-sdk/actions/workflows/build-release.yml/badge.svg)](https://github.com/IBM/networking-python-sdk/actions/workflows/build-release.yml)
22
[![Release](https://img.shields.io/github/v/release/IBM/networking-python-sdk)](https://github.com/IBM/networking-python-sdk/releases/latest)
33
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ibm-cloud-networking-services)](https://pypi.org/project/ibm-cloud-networking-services/)
44
[![PyPI](https://img.shields.io/pypi/v/ibm-cloud-networking-services)](https://pypi.org/project/ibm-cloud-networking-services/)
@@ -92,7 +92,7 @@ IBM Cloud services:
9292

9393
- An [IBM Cloud][ibm-cloud-onboarding] account.
9494
- An IAM API key to allow the SDK to access your account. Create one [here](https://cloud.ibm.com/iam/apikeys).
95-
- Python 3.6 or above.
95+
- Python 3.10 or above.
9696

9797
## Installation
9898

0 commit comments

Comments
 (0)