diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..28f125f --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,59 @@ +name: pr + +on: + pull_request: + branches: + - main + workflow_dispatch: + # Allow workflow to be triggered manually. + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + detect-secrets: + name: detect-secrets + runs-on: ubuntu-latest + timeout-minutes: 30 + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: 3.12 + cache: 'pip' + + - name: Install detect-secrets + run: | + pip install --upgrade "git+https://github.com/ibm/detect-secrets.git@master#egg=detect-secrets" + + - name: Run detect-secrets + run: | + detect-secrets scan --update .secrets.baseline + detect-secrets -v audit --report --fail-on-unaudited --fail-on-live --fail-on-audited-real .secrets.baseline + + build-test: + name: Build and Test (Python ${{ matrix.python-version }}) + needs: detect-secrets + runs-on: ubuntu-latest + timeout-minutes: 30 + strategy: + matrix: + python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] + + steps: + - name: Checkout code + 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: Run CI build + run: make ci diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..dd3a052 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,99 @@ +name: release + +on: + push: + branches: + - main + workflow_dispatch: + inputs: + dry_run: + description: 'Run semantic-release in dry-run mode' + required: false + type: boolean + default: true + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + semantic-release: + name: Semantic Release + runs-on: ubuntu-latest + timeout-minutes: 30 + # Only run on one Python version to avoid duplicate releases + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + persist-credentials: false + fetch-depth: 0 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '24' + cache: 'npm' + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.9' + cache: 'pip' + + - name: Install Node.js dependencies + run: npm install + + - name: Install bump-my-version + run: pip install bump-my-version + + - name: Semantic Release (Dry Run) + if: github.event_name == 'workflow_dispatch' && inputs.dry_run + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + run: npm run semantic-release --dry-run + + - name: Semantic Release + if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && !inputs.dry_run) + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + run: npm run semantic-release + + publish: + name: Publish to PyPI + needs: semantic-release + runs-on: ubuntu-latest + timeout-minutes: 30 + if: (github.ref_name == 'main' && github.event_name == 'push') || (github.ref_name == 'main' && github.event_name == 'workflow_dispatch' && !inputs.dry_run) + + permissions: + contents: read + id-token: write # Required for trusted publishing + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.9' + cache: 'pip' + + - name: Run CI build + run: make ci + + - name: Install publish dependencies + run: make publish-deps + + - name: Build distribution + run: make build-dist + + # Requires TWINE_PASSWORD to be configured in secrets + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + verbose: true diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 80900f6..0000000 --- a/.travis.yml +++ /dev/null @@ -1,42 +0,0 @@ -language: python - -dist: jammy - -stages: - - name: Build-Test - if: tag IS blank - - name: Semantic-Release - if: (branch = main) AND (type IN (push, api)) AND (fork = false) - - name: Publish-Release - if: (tag IS present) AND (fork = false) - -install: true - -script: -- make ci - -jobs: - include: - - stage: Build-Test - python: "3.9" - - python: "3.10" - - python: "3.11" - - python: "3.12" - - python: "3.13" - - - stage: Semantic-Release - language: node_js - node_js: 22 - install: - - npm install - - pip install --user bump-my-version - script: - - npm run semantic-release - - - stage: Publish-Release - python: "3.9" - name: Publish-To-PyPi - script: - - make ci - - make publish-deps - - make publish-release \ No newline at end of file diff --git a/Makefile b/Makefile index b636a4e..50c26a0 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ -PYTHON=python3 +PYTHON=python +PYTHON3=python3 LINT=black LINT_DIRS=ibm_continuous_delivery test/unit test/integration examples diff --git a/README.md b/README.md index 5b96119..fc2b93f 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,16 @@ +# IBM Cloud Continuous Delivery Python SDK + [![Build Status](https://app.travis-ci.com/IBM/continuous-delivery-python-sdk.svg?branch=main)](https://app.travis-ci.com/github/IBM/continuous-delivery-python-sdk) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ibm-continuous-delivery)](https://pypi.org/project/ibm-continuous-delivery/) [![Latest Stable Version](https://img.shields.io/pypi/v/ibm-continuous-delivery.svg)](https://pypi.python.org/pypi/ibm-continuous-delivery) [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) -# IBM Cloud Continuous Delivery Python SDK v2.0.5 - The Python client library to interact with the [IBM Cloud Continuous Delivery Toolchain and Tekton Pipeline APIs](https://cloud.ibm.com/docs?tab=api-docs&category=devops). -# Python Version -The current minimum Python version supported is 3.9. +## Version + +- The current version of this SDK: 2.0.5 +- The current minimum Python version supported: 3.9 ## Table of Contents @@ -24,7 +26,7 @@ The current minimum Python version supported is 3.9. -- [IBM Cloud Continuous Delivery Python SDK v2.0.5](#ibm-cloud-continuous-delivery-python-sdk-v170) +- [IBM Cloud Continuous Delivery Python SDK](#ibm-cloud-continuous-delivery-python-sdk) - [Python Version](#python-version) - [Table of Contents](#table-of-contents) - [Overview](#overview) @@ -53,9 +55,9 @@ Service Name | Module Name | Imported Class Name [ibm-cloud-onboarding]: https://cloud.ibm.com/registration -* 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.7 or above. +- 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.9 or above. ## Installation @@ -66,24 +68,19 @@ python -m pip install --upgrade ibm-continuous-delivery ``` ## Using the SDK -For general SDK usage information, please see [this link](https://github.com/IBM/ibm-cloud-sdk-common/blob/main/README.md) - -## Questions -If you are having difficulties using this SDK or have a question about the IBM Cloud services, -please ask a question at -[Stack Overflow](http://stackoverflow.com/questions/ask?tags=ibm-cloud). -Alternatively, you can reach out to the IBM Cloud Continuous Delivery development team by joining us on [Slack](https://ic-devops-slack-invite.us-south.devops.cloud.ibm.com/). +For general SDK usage information, please see [this link](https://github.com/IBM/ibm-cloud-sdk-common/blob/main/README.md). ## Issues -If you encounter an issue with the project, you are welcome to submit a -[bug report](https://github.com/IBM/continuous-delivery-python-sdk/issues). -Before that, please search for similar issues. It's possible that someone has already reported the problem. + +If you encounter an issue with the project, you are welcome to submit a [bug report](https://github.com/IBM/continuous-delivery-python-sdk/issues). Before that, please search for similar issues. It's possible that someone has already reported the problem. ## Open source @ IBM -Find more open source projects on the [IBM Github Page](http://ibm.github.io/) + +Find more open source projects on the [IBM Github Page](http://ibm.github.io/). ## Contributing + See [CONTRIBUTING.md](https://github.com/IBM/continuous-delivery-python-sdk/blob/main/CONTRIBUTING.md). ## License diff --git a/package.json b/package.json index b8a7699..2d2f3ab 100644 --- a/package.json +++ b/package.json @@ -4,14 +4,11 @@ "description": "This package.json is being used to manage semantic-release and its dependencies", "license": "Apache-2.0", "devDependencies": { - "semantic-release": "21.0.7", + "semantic-release": "^25.0.3", "@semantic-release/changelog": "6.0.3", "@semantic-release/exec": "6.0.3", "@semantic-release/git": "10.0.1" }, - "overrides": { - "semver": "^7.5.3" - }, "scripts": { "semantic-release": "semantic-release" }