-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add trusted publishing support (#1194)
- Loading branch information
1 parent
f6e5409
commit 8c82b8c
Showing
2 changed files
with
42 additions
and
2 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,8 +56,48 @@ 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. | ||
|
||
![Trusted Publisher](assets/trusted_publisher.png) | ||
|
||
|
||
Here you can find an example GitHub Actions workflow | ||
|
||
```yaml title=".github/workflows/build.yml" | ||
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 "${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 | ||
|