Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ea5af31

Browse filesBrowse files
committed
feat(ci): switch to OIDC publishing
1 parent a2b8c8c commit ea5af31
Copy full SHA for ea5af31

File tree

Expand file treeCollapse file tree

2 files changed

+11
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+11
-2
lines changed
Open diff view settings
Collapse file

‎.github/workflows/release.yml‎

Copy file name to clipboardExpand all lines: .github/workflows/release.yml
+10-2Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,23 @@ on:
77

88
jobs:
99
release:
10-
if: github.repository == 'python-gitlab/python-gitlab'
10+
if: github.repository == 'nejch/python-gitlab' # testing via test.pypi.org first
1111
runs-on: ubuntu-latest
12+
environment: test.pypi.org # testing via test.pypi.org first
1213
steps:
1314
- uses: actions/checkout@v3.5.0
1415
with:
1516
fetch-depth: 0
1617
token: ${{ secrets.RELEASE_GITHUB_TOKEN }}
18+
- name: mint API token
19+
id: mint-token
20+
run: |
21+
oidc_token=$(curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=testpypi" | jq '.value')
22+
api_token=$(curl -X POST https://test.pypi.org/_/oidc/github/mint-token -d "{\"token\": \"${oidc_token}\"}" | jq '.token')
23+
echo "::add-mask::${api_token}"
24+
echo "api-token=${api_token}" >> "${GITHUB_OUTPUT}"
1725
- name: Python Semantic Release
1826
uses: relekang/python-semantic-release@v7.33.2
1927
with:
2028
github_token: ${{ secrets.RELEASE_GITHUB_TOKEN }}
21-
pypi_token: ${{ secrets.PYPI_TOKEN }}
29+
pypi_token: ${{ steps.mint-token.outputs.api-token }}
Collapse file

‎pyproject.toml‎

Copy file name to clipboardExpand all lines: pyproject.toml
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ branch = "main"
3030
version_variable = "gitlab/_version.py:__version__"
3131
commit_subject = "chore: release v{version}"
3232
commit_message = ""
33+
repository = "testpypi" # testing via test.pypi.org first
3334

3435
[tool.pylint.messages_control]
3536
max-line-length = 88

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.