From e4494c8c80a21f5e645346a7e2323fd14a9610e2 Mon Sep 17 00:00:00 2001 From: pulpbot Date: Sun, 30 Nov 2025 03:04:32 +0000 Subject: [PATCH] Update CI files --- .github/workflows/publish.yml | 88 ++++++------------- .github/workflows/release.yml | 4 +- .../workflows/scripts/publish_client_gem.sh | 28 ------ .../workflows/scripts/publish_client_pypi.sh | 26 ------ .../workflows/scripts/publish_plugin_pypi.sh | 26 ------ .github/workflows/test.yml | 2 +- lint_requirements.txt | 3 - 7 files changed, 29 insertions(+), 148 deletions(-) delete mode 100755 .github/workflows/scripts/publish_client_gem.sh delete mode 100755 .github/workflows/scripts/publish_client_pypi.sh delete mode 100755 .github/workflows/scripts/publish_plugin_pypi.sh diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 018013ad..525144fa 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -23,47 +23,28 @@ jobs: runs-on: "ubuntu-latest" needs: - "build" - - env: - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + environment: + name: "pypi" + url: "https://pypi.org/p/pulp-python" + permissions: + id-token: "write" steps: - - uses: "actions/checkout@v4" - with: - fetch-depth: 1 - path: "pulp_python" - - uses: "actions/download-artifact@v4" with: name: "plugin_package" - path: "pulp_python/dist/" + path: "dist/" - - uses: "actions/setup-python@v5" - with: - python-version: "3.11" - - - name: "Install python dependencies" - run: | - echo ::group::PYDEPS - pip install twine - echo ::endgroup:: - - - name: "Setting secrets" - run: | - python3 .github/workflows/scripts/secrets.py "$SECRETS_CONTEXT" - env: - SECRETS_CONTEXT: "${{ toJson(secrets) }}" - - - name: "Deploy plugin to pypi" - run: | - .github/workflows/scripts/publish_plugin_pypi.sh ${{ github.ref_name }} + - name: "Publish package to PyPI" + uses: pypa/gh-action-pypi-publish@release/v1 publish-python-bindings: runs-on: "ubuntu-latest" needs: - "build" - - env: - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + environment: + name: "pypi" + permissions: + id-token: "write" steps: - uses: "actions/checkout@v4" @@ -81,32 +62,18 @@ jobs: run: | tar -xvf python-python-client.tar - - uses: "actions/setup-python@v5" - with: - python-version: "3.11" - - - name: "Install python dependencies" - run: | - echo ::group::PYDEPS - pip install twine - echo ::endgroup:: - - - name: "Setting secrets" - run: | - python3 .github/workflows/scripts/secrets.py "$SECRETS_CONTEXT" - env: - SECRETS_CONTEXT: "${{ toJson(secrets) }}" - - name: "Publish client to pypi" - run: | - bash .github/workflows/scripts/publish_client_pypi.sh ${{ github.ref_name }} + uses: pypa/gh-action-pypi-publish@release/v1 + with: + packages-dir: "pulp_python/dist/" publish-ruby-bindings: runs-on: "ubuntu-latest" needs: - "build" - - env: - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + environment: + name: "rubygems" + permissions: + id-token: "write" steps: - uses: "actions/checkout@v4" @@ -128,15 +95,12 @@ jobs: with: ruby-version: "2.6" - - name: "Setting secrets" - run: | - python3 .github/workflows/scripts/secrets.py "$SECRETS_CONTEXT" - env: - SECRETS_CONTEXT: "${{ toJson(secrets) }}" + - name: "Set RubyGems Credentials" + uses: "rubygems/configure-rubygems-credentials@v1.0.0" - - name: "Publish client to rubygems" + - name: "Publish client to RubyGems" run: | - bash .github/workflows/scripts/publish_client_gem.sh ${{ github.ref_name }} + gem push "pulp_python_client-${{ github.ref_name }}.gem" create-gh-release: runs-on: "ubuntu-latest" @@ -179,14 +143,16 @@ jobs: - name: "Create release on GitHub" uses: "actions/github-script@v7" + env: + RELEASE_BODY: ${{ steps.get_release_notes.outputs.body }} with: script: | - const { TAG_NAME } = process.env; + const { TAG_NAME, RELEASE_BODY } = process.env; await github.rest.repos.createRelease({ owner: context.repo.owner, repo: context.repo.repo, tag_name: TAG_NAME, - body: `${{ steps.get_release_notes.outputs.body }}`, + body: RELEASE_BODY, make_latest: "legacy", }); diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7291dadd..b758bae6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,12 +32,10 @@ jobs: with: python-version: "3.11" - # Click is pinned because of: - # https://github.com/pallets/click/issues/3065 - name: "Install python dependencies" run: | echo ::group::PYDEPS - pip install bump-my-version towncrier 'click<8.3' + pip install bump-my-version towncrier echo ::endgroup:: - name: "Configure Git with pulpbot name and email" diff --git a/.github/workflows/scripts/publish_client_gem.sh b/.github/workflows/scripts/publish_client_gem.sh deleted file mode 100755 index e771b5e7..00000000 --- a/.github/workflows/scripts/publish_client_gem.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -# WARNING: DO NOT EDIT! -# -# This file was generated by plugin_template, and is managed by it. Please use -# './plugin-template --github pulp_python' to update this file. -# -# For more info visit https://github.com/pulp/plugin_template - -set -euv - -# make sure this script runs at the repo root -cd "$(dirname "$(realpath -e "$0")")"/../../.. - -VERSION="$1" - -if [[ -z "${VERSION}" ]] -then - echo "No version specified." - exit 1 -fi - -mkdir -p ~/.gem -touch ~/.gem/credentials -echo "--- -:rubygems_api_key: ${RUBYGEMS_API_KEY}" > ~/.gem/credentials -sudo chmod 600 ~/.gem/credentials -gem push "pulp_python_client-${VERSION}.gem" diff --git a/.github/workflows/scripts/publish_client_pypi.sh b/.github/workflows/scripts/publish_client_pypi.sh deleted file mode 100755 index c5a4295c..00000000 --- a/.github/workflows/scripts/publish_client_pypi.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -# WARNING: DO NOT EDIT! -# -# This file was generated by plugin_template, and is managed by it. Please use -# './plugin-template --github pulp_python' to update this file. -# -# For more info visit https://github.com/pulp/plugin_template - -set -euv - -# make sure this script runs at the repo root -cd "$(dirname "$(realpath -e "$0")")/../../.." - -VERSION="$1" - -if [[ -z "${VERSION}" ]] -then - echo "No version specified." - exit 1 -fi - -twine upload -u __token__ -p "${PYPI_API_TOKEN}" \ -"dist/pulp_python_client-${VERSION}-py3-none-any.whl" \ -"dist/pulp_python_client-${VERSION}.tar.gz" \ -; diff --git a/.github/workflows/scripts/publish_plugin_pypi.sh b/.github/workflows/scripts/publish_plugin_pypi.sh deleted file mode 100755 index 16b0ce05..00000000 --- a/.github/workflows/scripts/publish_plugin_pypi.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -# WARNING: DO NOT EDIT! -# -# This file was generated by plugin_template, and is managed by it. Please use -# './plugin-template --github pulp_python' to update this file. -# -# For more info visit https://github.com/pulp/plugin_template - -set -euv - -# make sure this script runs at the repo root -cd "$(dirname "$(realpath -e "$0")")"/../../.. - -VERSION="$1" - -if [[ -z "${VERSION}" ]] -then - echo "No version specified." - exit 1 -fi - -twine upload -u __token__ -p "${PYPI_API_TOKEN}" \ -dist/pulp?python-"${VERSION}"-py3-none-any.whl \ -dist/pulp?python-"${VERSION}".tar.gz \ -; diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7a244d25..88cfd8f3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -71,7 +71,7 @@ jobs: - name: "Install python dependencies" run: | echo ::group::PYDEPS - pip install build towncrier twine wheel httpie docker netaddr boto3 'ansible~=10.3.0' mkdocs jq jsonpatch bump-my-version 'click<8.3' + pip install build towncrier twine wheel httpie docker netaddr boto3 'ansible~=10.3.0' mkdocs jq jsonpatch bump-my-version echo "HTTPIE_CONFIG_DIR=$GITHUB_WORKSPACE/pulp_python/.ci/assets/httpie/" >> $GITHUB_ENV echo ::endgroup:: diff --git a/lint_requirements.txt b/lint_requirements.txt index 092ccbd0..a2936209 100644 --- a/lint_requirements.txt +++ b/lint_requirements.txt @@ -5,9 +5,6 @@ # # For more info visit https://github.com/pulp/plugin_template -# Click is pinned because of: -# https://github.com/pallets/click/issues/3065 -click<8.3 bump-my-version check-manifest flake8