Skip to content
Closed
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
88 changes: 27 additions & 61 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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/[email protected]"

- 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"
Expand Down Expand Up @@ -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",
});
Loading