Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: trusted publishing support #1194

Merged
merged 9 commits into from
Nov 14, 2024
Merged
Changes from 2 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
41 changes: 39 additions & 2 deletions docs/authentication_and_upload.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,45 @@ authenticate with the server.

### prefix.dev

To upload to [prefix.dev](https://prefix.dev), you need to have an account and a
token. You can create a token in the settings of your account. The token is used
#### OpenID Connect (OIDC)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we start calling it something like Trusted publishing via OIDC or so?

OIDC is very technical and trusted publishing is maybe easier to grasp (also if you know pypi of course).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adapted the heading


`rattler-build` supports authentication with https://prefix.dev through OIDC with GitHub Actions.
That way you don't need to manually retrieve and store a token.
Hofer-Julian marked this conversation as resolved.
Show resolved Hide resolved
You only have to set up a specific repository and workflow under "Trusted Publishers" on prefix.dev.

Here you can find an example GitHub Actions workflow

Hofer-Julian marked this conversation as resolved.
Show resolved Hide resolved
```yaml
wolfv marked this conversation as resolved.
Show resolved Hide resolved
permissions:
contents: read
id-token: write

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build conda package
uses: prefix-dev/[email protected]

- name: Upload all packages
shell: bash
run: |
shopt -s nullglob
EXIT_CODE=0
for pkg in $(find output -type f \( -name "*.conda" -o -name "*.tar.bz2" \) ); do
if ! rattler-build upload prefix -c my-channel "$file"; then
EXIT_CODE=1
fi
done
exit $EXIT_CODE
Hofer-Julian marked this conversation as resolved.
Show resolved Hide resolved
tdejager marked this conversation as resolved.
Show resolved Hide resolved
```


#### Token

To upload to [prefix.dev](https://prefix.dev), you need to have an account.
You can then create a token in the settings of your account. The token is used
to authenticate the upload.

```bash
Expand Down
Loading