feat: forward rattler build source errors #166
Workflow file for this run
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
on: | |
push: | |
# Run full workflow on tags | |
tags: | |
- "v[0-9]+.[0-9]+.[0-9]+" | |
# Run everything but publish on PRs | |
pull_request: | |
name: "Build Conda Package" | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
generate_version: | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.set_version.outputs.version }} | |
steps: | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- uses: actions/checkout@v4 | |
- name: Set version | |
id: set_version | |
run: | | |
# Modify this if we split up in different crates so we can version them differently | |
VERSION=$(cargo metadata --format-version=1 --no-deps | jq -r '.packages[] | "\(.version)"') | |
echo "Generated version: $VERSION" | |
echo "version=$VERSION" >> $GITHUB_OUTPUT | |
rattler-build: | |
needs: generate_version | |
env: | |
REPO_NAME: "prefix-dev/pixi-build-backends" | |
strategy: | |
matrix: | |
include: | |
- { target: linux-64, os: ubuntu-20.04 } | |
- { target: linux-aarch64, os: ubuntu-latest } | |
- { target: linux-ppc64le, os: ubuntu-latest } | |
- { target: win-64, os: windows-latest } | |
# force older macos-13 to get x86_64 runners | |
- { target: osx-64, os: macos-13 } | |
- { target: osx-arm64, os: macos-14 } | |
fail-fast: false | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: prefix-dev/setup-pixi@ba3bb36eb2066252b2363392b7739741bb777659 # v0.8.1 | |
with: | |
environments: build-self | |
- name: Enable long paths | |
if: ${{ matrix.os == 'windows-latest' }} | |
run: | | |
git config --global core.longpaths true | |
shell: bash | |
- name: Run rattler-build | |
shell: bash | |
env: | |
TARGET_PLATFORM: ${{ matrix.target }} | |
RECIPE_VERSION: ${{ needs.generate_version.outputs.version }} | |
RATTLER_BUILD_ENABLE_GITHUB_INTEGRATION: "true" | |
RATTLER_BUILD_COLOR: "always" | |
run: | | |
pixi r -e build-self rattler-build build --recipe recipe/recipe.yaml --output-dir=$RUNNER_TEMP --target-platform=${{ env.TARGET_PLATFORM }} --experimental --test native | |
- name: Upload OSX or Linux packages | |
shell: bash | |
# do not upload on PR or fork | |
if: ${{ github.event_name == 'push' && matrix.os != 'windows-latest' && github.repository == env.REPO_NAME }} | |
run: | | |
# ignore errors because we want to ignore duplicate packages | |
for file in "$RUNNER_TEMP"/**/*.conda; do | |
echo "Uploading ${file}" | |
pixi r -e build-self rattler-build upload prefix -c pixi-build-backends "$file" | |
done | |
- name: Upload Windows packages | |
shell: pwsh | |
if: ${{ github.event_name == 'push' && matrix.os == 'windows-latest' && github.repository == env.REPO_NAME }} | |
run: | | |
# ignore errors because we want to ignore duplicate packages | |
Get-ChildItem -Path $env:RUNNER_TEMP -Filter *.conda -Recurse | ForEach-Object { | |
Write-Host "Uploading $($_.FullName)" | |
pixi r -e build-self rattler-build upload prefix -c pixi-build-backends "$($_.FullName)" | |
} |