Skip to content

Rebuild with provenance metadata #193

Rebuild with provenance metadata

Rebuild with provenance metadata #193

Workflow file for this run

name: Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
# Concurrency group that uses the workflow name and PR number if available
# or commit SHA as a fallback. If a new build is triggered under that
# concurrency group while a previous build is running it will be canceled.
# Repeated pushes to a PR will cancel all previous builds, while multiple
# merges to main will not cancel.
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
conda_build_recipe:
name: Build conda recipe (${{ matrix.subdir }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
subdir: win-64
- os: windows-latest
subdir: win-arm64
env:
PYTHONUNBUFFERED: "1"
steps:
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
- uses: conda-incubator/setup-miniconda@835234971496cad1653abb28a638a281cf32541f # v3.2.0
with:
auto-activate-base: true
activate-environment: ""
run-post: false
- name: Install dependencies
shell: bash -el {0}
run: conda install -y --override-channels -c defaults "conda-build!=3.28.0,!=3.28.1" anaconda-client
- name: conda info
shell: bash -el {0}
run: |
set -x
conda info
conda config --show-sources
conda list
- name: Build recipe
shell: bash -el {0}
env:
CONDA_BLD_PATH: ${{ runner.temp }}/bld
run: |
conda build recipe \
--override-channels \
-c conda-forge \
-e .ci_support/${{ matrix.subdir }}.yaml \
--extra-meta \
flow_run_id="github_$GITHUB_RUN_ID" \
remote_url="https://github.com/$GITHUB_REPOSITORY" \
sha="$GITHUB_SHA"
- uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
if: github.event_name == 'pull_request'
with:
name: conda-launchers-${{ matrix.subdir }}
path: ${{ runner.temp }}/bld/${{ matrix.subdir }}/conda-launchers-*.*
- name: Upload package to anaconda.org
shell: bash -el {0}
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
env:
CONDA_BLD_PATH: ${{ runner.temp }}/bld
ANACONDA_ORG_TOKEN: ${{ secrets.ANACONDA_ORG_CONDA_CANARY_TOKEN }}
ANACONDA_ORG_CHANNEL: conda-canary
ANACONDA_ORG_LABEL: conda-launchers_dev
run: |
anaconda \
--token="${ANACONDA_ORG_TOKEN}" \
upload \
--force \
--register \
--no-progress \
--user="${ANACONDA_ORG_CHANNEL}" \
--label="${ANACONDA_ORG_LABEL}" \
${CONDA_BLD_PATH}/${{ matrix.subdir }}/conda-launchers-*.*
echo "Uploaded the following files:"
basename -a ${CONDA_BLD_PATH}/${{ matrix.subdir }}/conda-launchers-*.*
echo "Use this command to try out the build:"
echo " conda install -c ${ANACONDA_ORG_CHANNEL}/label/${ANACONDA_ORG_LABEL} conda-launchers"
rattler_build_recipe:
name: Rattler build recipe
runs-on: windows-latest
steps:
- name: Checkout Source
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
fetch-depth: 1
- name: Setup Pixi
uses: prefix-dev/setup-pixi@82d477f15f3a381dbcc8adc1206ce643fe110fb7 # v0.9.3
with:
cache: true
- name: Pixi info
shell: pwsh
run: |
pixi info
pixi list
- name: Run Build
shell: pwsh
run: |
pixi run build `
--extra-meta flow_run_id="github_$GITHUB_RUN_ID" `
--extra-meta remote_url="https://github.com/$GITHUB_REPOSITORY" `
--extra-meta sha="$GITHUB_SHA"
- name: Upload Artifacts
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: conda-launchers-zig-builds
path: |
./output/noarch/conda-launchers*.conda
- name: Upload to Anaconda
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
env:
ANACONDA_OWNER: conda-canary
ANACONDA_CHANNEL: conda-launchers-zig_dev
ANACONDA_API_KEY: ${{ secrets.ANACONDA_ORG_CONDA_CANARY_TOKEN }}
shell: pwsh
run: |
if (-not $env:ANACONDA_API_KEY -or $env:ANACONDA_API_KEY -eq '') {
Write-Error "ANACONDA_API_KEY is not set."
exit 1
}
foreach ($file in Get-ChildItem -Path "./output/noarch/conda-launchers*.conda") {
Write-Host "Uploading $($file.Name)"
pixi run upload "$file"
}