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

Add upload to prefix.dev example #9

Merged
merged 2 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
11 changes: 1 addition & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,9 @@ jobs:
- name: Check rattler-build-action version mentions
run: |
project_version="$(yq '.version' project.toml)"
count_expected=5
count_expected=6
count_actual="$(grep -c "prefix-dev/rattler-build-action@v${project_version}" README.md || true)"
if [ "$count_actual" -ne "$count_expected" ]; then
echo "::error file=README.md::Expected $count_expected mentions of \`rattler-build-action@v$project_version\` in README.md, but found $count_actual."
exit 1
fi
- name: Check rattler-build version mentions
run: |
rattler_build_version="$(yq '.inputs.rattler-build-version' action.yml)"
count_expected=1
count_actual="$(grep -c "rattler-build-version" README.md | grep "$rattler_build_version" || true)"
if [ "$count_actual" -ne "$count_expected" ]; then
echo "::error file=README.md::Expected $count_expected mentions of \`rattler-build\` version \`0.6.0\` in README.md, but found $count_actual."
exit 1
fi
30 changes: 25 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Build conda package
uses: prefix-dev/[email protected].0
uses: prefix-dev/[email protected].1
```

> [!WARNING]
> Since rattler-build is still experimental and the API can change in minor versions, please pin this action to its minor version, i.e., `prefix-dev/[email protected].0`.
> Since rattler-build is still experimental and the API can change in minor versions, please pin this action to its minor version, i.e., `prefix-dev/[email protected].1`.

> [!TIP]
> You can use dependabot to automatically update the version of `rattler-build-action`. Add the following to your `.github/dependabot.yml`:
Expand Down Expand Up @@ -100,7 +100,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Build conda package
uses: prefix-dev/[email protected].0
uses: prefix-dev/[email protected].1
with:
# needs to be unique for each matrix entry
artifact-name: package-${{ matrix.target-platform }}
Expand All @@ -117,7 +117,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Build conda package
uses: prefix-dev/[email protected].0
uses: prefix-dev/[email protected].1
- run: |
for pkg in $(find output -type f \( -name "*.conda" -o -name "*.tar.bz2" \) ); do
echo "Uploading ${pkg}"
Expand All @@ -129,6 +129,26 @@ jobs:
QUETZ_CHANNEL: my-channel
```

### Upload to prefix.dev

```yml
jobs:
build:
name: Build package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build conda package
uses: prefix-dev/[email protected]
- run: |
for pkg in $(find output -type f \( -name "*.conda" -o -name "*.tar.bz2" \) ); do
echo "Uploading ${pkg}"
rattler-build upload prefix -c my-channel "${pkg}"
done
env:
PREFIX_API_KEY: ${{ secrets.PREFIX_API_KEY }}
```

### Use private channel

You can use a private channel while building your conda package by setting the `RATTLER_AUTH_FILE` environment variable.
Expand All @@ -147,7 +167,7 @@ jobs:
echo '{"my.quetz.server": {"CondaToken": "${{ secrets.QUETZ_API_KEY }}"}}' > "$RATTLER_AUTH_FILE"
echo "RATTLER_AUTH_FILE=$RATTLER_AUTH_FILE" >> "$GITHUB_ENV"
- name: Build conda package
uses: prefix-dev/[email protected].0
uses: prefix-dev/[email protected].1
with:
build-args: -c conda-forge -c https://my.quetz.server/get/my-channel
```
2 changes: 1 addition & 1 deletion project.toml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = "0.2.0"
version = "0.2.1"