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 6 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
#### Trusted publishing via OIDC

`rattler-build` supports authentication with https://prefix.dev through OIDC with GitHub Actions.
An API key is no longer required, rattler-build can manage the complete authentication workflow for you.
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/rattler-build-action@v0.2.19

- 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 "${pkg}"; then
EXIT_CODE=1
fi
done
exit $EXIT_CODE
```


#### 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