Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 86 additions & 0 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Build & Release

on:
push:
branches: ['**']
pull_request:
branches: ['**']
workflow_dispatch:
# Allow workflow to be triggered manually.

permissions:
contents: read

jobs:
build:
name: build-test (python ${{ matrix.python-version }})
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13']

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: Install pandoc
run: |
sudo apt-get update
sudo apt-get install pandoc
pip install pypandoc

- name: Install dependencies
run: pip install 'tox<4' tox-gh-actions

- name: Run tests
run: tox

create-release:
name: semantic-release
if: "github.ref_name == 'master' && github.event_name != 'pull_request'"
needs: build
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Install Publishing Tools
run: |
pip install bump2version build twine
npm install

- name: Run semantic-release
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: npx semantic-release

- name: Publish to PyPI
if: success()
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
python -m build
python -m twine upload dist/* -u __token__ -p $PYPI_TOKEN
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Build Status](https://travis-ci.com/IBM/networking-python-sdk.svg?branch=master)](https://travis-ci.com/IBM/networking-python-sdk)
[![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)
[![Release](https://img.shields.io/github/v/release/IBM/networking-python-sdk)](https://github.com/IBM/networking-python-sdk/releases/latest)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ibm-cloud-networking-services)](https://pypi.org/project/ibm-cloud-networking-services/)
[![PyPI](https://img.shields.io/pypi/v/ibm-cloud-networking-services)](https://pypi.org/project/ibm-cloud-networking-services/)
Expand Down Expand Up @@ -92,7 +92,7 @@ IBM Cloud services:

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

## Installation

Expand Down
Loading