Skip to content

Stop pinning backends (#162) #372

Stop pinning backends (#162)

Stop pinning backends (#162) #372

Workflow file for this run

on:
push:
# Run full workflow on tags
tags:
- "pixi-build-cmake-v[0-9]+.[0-9]+.[0-9]+"
- "pixi-build-python-v[0-9]+.[0-9]+.[0-9]+"
- "pixi-build-rattler-build-v[0-9]+.[0-9]+.[0-9]+"
- "pixi-build-rust-v[0-9]+.[0-9]+.[0-9]+"
# Build all backends on main branch
branches: [main]
workflow_dispatch:
name: "Build and publish pixi builds backends as conda packages"
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
permissions:
id-token: write
contents: read
jobs:
generate-version:
runs-on: ubuntu-latest
outputs:
version_matrix: ${{ steps.set_version.outputs.version_matrix }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: actions-rust-lang/setup-rust-toolchain@9399c7bb15d4c7d47b27263d024f0a4978346ba4 # v1
- uses: prefix-dev/setup-pixi@ba3bb36eb2066252b2363392b7739741bb777659 # v0.8.1
with:
environments: release
- name: Extract versions
id: set_version
run: |
# extract names and versions from cargo metadata
# and generate a matrix entries for the build job
MATRIX_JSON=$(pixi run python scripts/generate_version_matrix.py)
echo "Generated matrix: $MATRIX_JSON"
echo "version_matrix=$MATRIX_JSON" >> $GITHUB_OUTPUT
rattler-build:
needs: generate-version
env:
REPO_NAME: "prefix-dev/pixi-build-backends"
strategy:
matrix:
bins: ${{ fromJSON(needs.generate-version.outputs.version_matrix) }}
fail-fast: false
runs-on: ${{ matrix.bins.os }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: prefix-dev/setup-pixi@ba3bb36eb2066252b2363392b7739741bb777659 # v0.8.1
with:
environments: build
- name: Enable long paths (Windows)
if: ${{ matrix.bins.os == 'windows-latest' }}
run: |
git config --global core.longpaths true
shell: bash
- name: Build ${{ matrix.bins.bin }}
shell: bash
env:
TARGET_PLATFORM: ${{ matrix.bins.target }}
RATTLER_BUILD_ENABLE_GITHUB_INTEGRATION: "true"
RATTLER_BUILD_COLOR: "always"
# set the secret for the sccache depot
SCCACHE_WEBDAV_ENDPOINT: ${{ secrets.SCCACHE_WEBDAV_ENDPOINT }}
SCCACHE_WEBDAV_TOKEN: ${{ secrets.SCCACHE_WEBDAV_TOKEN }}
run: |
pixi run build-package --manifest-path crates/${{ matrix.bins.crate_name }} --target-platform=${{ env.TARGET_PLATFORM }}
- name: Upload OSX or Linux packages
shell: bash
if: ${{ startsWith(github.ref, 'refs/tags') && matrix.bins.os != 'windows-latest' && github.repository == env.REPO_NAME }}
run: |
for file in "$RUNNER_TEMP"/*.conda; do
echo "Uploading ${file}"
pixi run -e build rattler-build upload prefix -c pixi-build-backends "$file"
done
- name: Upload Windows packages
shell: pwsh
if: ${{ startsWith(github.ref, 'refs/tags') && matrix.bins.os == 'windows-latest' && github.repository == env.REPO_NAME }}
run: |
Get-ChildItem -Path $env:RUNNER_TEMP -Filter *.conda | ForEach-Object {
Write-Host "Uploading $($_.FullName)"
pixi run -e build rattler-build upload prefix -c pixi-build-backends "$($_.FullName)"
}