Skip to content

Commit df5f773

Browse files
committed
Update CI files
1 parent eed9496 commit df5f773

File tree

4 files changed

+27
-141
lines changed

4 files changed

+27
-141
lines changed

.github/workflows/publish.yml

Lines changed: 27 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -23,47 +23,28 @@ jobs:
2323
runs-on: "ubuntu-latest"
2424
needs:
2525
- "build"
26-
27-
env:
28-
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
26+
environment:
27+
name: "pypi"
28+
url: "https://pypi.org/p/pulp-python"
29+
permissions:
30+
id-token: "write"
2931

3032
steps:
31-
- uses: "actions/checkout@v4"
32-
with:
33-
fetch-depth: 1
34-
path: "pulp_python"
35-
3633
- uses: "actions/download-artifact@v4"
3734
with:
3835
name: "plugin_package"
39-
path: "pulp_python/dist/"
36+
path: "dist/"
4037

41-
- uses: "actions/setup-python@v5"
42-
with:
43-
python-version: "3.11"
44-
45-
- name: "Install python dependencies"
46-
run: |
47-
echo ::group::PYDEPS
48-
pip install twine
49-
echo ::endgroup::
50-
51-
- name: "Setting secrets"
52-
run: |
53-
python3 .github/workflows/scripts/secrets.py "$SECRETS_CONTEXT"
54-
env:
55-
SECRETS_CONTEXT: "${{ toJson(secrets) }}"
56-
57-
- name: "Deploy plugin to pypi"
58-
run: |
59-
.github/workflows/scripts/publish_plugin_pypi.sh ${{ github.ref_name }}
38+
- name: "Publish package to PyPI"
39+
uses: pypa/gh-action-pypi-publish@release/v1
6040
publish-python-bindings:
6141
runs-on: "ubuntu-latest"
6242
needs:
6343
- "build"
64-
65-
env:
66-
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
44+
environment:
45+
name: "pypi"
46+
permissions:
47+
id-token: "write"
6748

6849
steps:
6950
- uses: "actions/checkout@v4"
@@ -81,32 +62,18 @@ jobs:
8162
run: |
8263
tar -xvf python-python-client.tar
8364
84-
- uses: "actions/setup-python@v5"
85-
with:
86-
python-version: "3.11"
87-
88-
- name: "Install python dependencies"
89-
run: |
90-
echo ::group::PYDEPS
91-
pip install twine
92-
echo ::endgroup::
93-
94-
- name: "Setting secrets"
95-
run: |
96-
python3 .github/workflows/scripts/secrets.py "$SECRETS_CONTEXT"
97-
env:
98-
SECRETS_CONTEXT: "${{ toJson(secrets) }}"
99-
10065
- name: "Publish client to pypi"
101-
run: |
102-
bash .github/workflows/scripts/publish_client_pypi.sh ${{ github.ref_name }}
66+
uses: pypa/gh-action-pypi-publish@release/v1
67+
with:
68+
packages-dir: "pulp_python/dist/"
10369
publish-ruby-bindings:
10470
runs-on: "ubuntu-latest"
10571
needs:
10672
- "build"
107-
108-
env:
109-
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
73+
environment:
74+
name: "rubygems"
75+
permissions:
76+
id-token: "write"
11077

11178
steps:
11279
- uses: "actions/checkout@v4"
@@ -128,15 +95,12 @@ jobs:
12895
with:
12996
ruby-version: "2.6"
13097

131-
- name: "Setting secrets"
132-
run: |
133-
python3 .github/workflows/scripts/secrets.py "$SECRETS_CONTEXT"
134-
env:
135-
SECRETS_CONTEXT: "${{ toJson(secrets) }}"
98+
- name: "Set RubyGems Credentials"
99+
uses: "rubygems/[email protected]"
136100

137-
- name: "Publish client to rubygems"
101+
- name: "Publish client to RubyGems"
138102
run: |
139-
bash .github/workflows/scripts/publish_client_gem.sh ${{ github.ref_name }}
103+
gem push "pulp_python_client-${{ github.ref_name }}.gem"
140104
141105
create-gh-release:
142106
runs-on: "ubuntu-latest"
@@ -179,14 +143,16 @@ jobs:
179143
180144
- name: "Create release on GitHub"
181145
uses: "actions/github-script@v7"
146+
env:
147+
RELEASE_BODY: ${{ steps.get_release_notes.outputs.body }}
182148
with:
183149
script: |
184-
const { TAG_NAME } = process.env;
150+
const { TAG_NAME, RELEASE_BODY } = process.env;
185151
186152
await github.rest.repos.createRelease({
187153
owner: context.repo.owner,
188154
repo: context.repo.repo,
189155
tag_name: TAG_NAME,
190-
body: `${{ steps.get_release_notes.outputs.body }}`,
156+
body: RELEASE_BODY,
191157
make_latest: "legacy",
192158
});

.github/workflows/scripts/publish_client_gem.sh

Lines changed: 0 additions & 28 deletions
This file was deleted.

.github/workflows/scripts/publish_client_pypi.sh

Lines changed: 0 additions & 26 deletions
This file was deleted.

.github/workflows/scripts/publish_plugin_pypi.sh

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)