-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add github workflow to build recipes.yaml recipes with rattler-build
- Loading branch information
1 parent
13304ef
commit dc1f8c1
Showing
1 changed file
with
75 additions
and
0 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,75 @@ | ||
on: | ||
pull_request: | ||
branches: main | ||
paths: | ||
- recipes/*/recipe.yaml | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
name: Build (${{ matrix.target }}) | ||
runs-on: ${{ matrix.host }} | ||
strategy: | ||
matrix: | ||
include: | ||
- { target: win-64, host: windows-latest } | ||
- { target: linux-64, host: ubuntu-latest } | ||
- { target: osx-64, host: macos-latest } | ||
|
||
steps: | ||
- name: Generate rattler-build URL | ||
shell: bash | ||
id: url | ||
run: | | ||
arch=$(uname -m) | ||
if [ "$arch" = "arm64" ]; then | ||
arch="aarch64" | ||
fi | ||
platform=${{ runner.os == 'macOS' && 'apple-darwin' || '' }}${{ runner.os == 'Linux' && 'unknown-linux-musl' || '' }}${{ runner.os == 'Windows' && 'pc-windows-msvc' || '' }} | ||
url="https://github.com/prefix-dev/rattler-build/releases/latest/download/rattler-build-$arch-$platform${{ runner.os == 'Windows' && '.exe' || '' }}" | ||
echo "url=$url" >> $GITHUB_OUTPUT | ||
- name: Install rattler-build (Unix) | ||
shell: bash | ||
if: ${{ runner.os != 'Windows' }} | ||
run: | | ||
mkdir -p ${{ runner.temp }}/rattler-build | ||
curl -Ls \ | ||
${{ steps.url.outputs.url }} \ | ||
-o ${{ runner.temp }}/rattler-build/rattler-build | ||
chmod +x ${{ runner.temp }}/rattler-build/rattler-build | ||
echo ${{ runner.temp }}/rattler-build >> $GITHUB_PATH | ||
- name: Install rattler-build (Windows) | ||
shell: powershell | ||
if: ${{ runner.os == 'Windows' }} | ||
run: | | ||
New-Item -ItemType Directory -Path "${{ runner.temp }}\rattler-build" -Force | ||
Invoke-WebRequest -Uri "${{ steps.url.outputs.url }}" -OutFile "${{ runner.temp }}\rattler-build\rattler-build.exe" | ||
Add-Content -Path $env:GITHUB_PATH -Value "${{ runner.temp }}\rattler-build" | ||
- name: Build conda package (non-Windows) | ||
shell: bash | ||
if: ${{ runner.os != 'Windows' }} | ||
run: | | ||
rattler-build build --recipe-dir recipes | ||
env: | ||
RATTLER_BUILD_ENABLE_GITHUB_INTEGRATION: 'true' | ||
RATTLER_BUILD_COLOR: 'always' | ||
- name: Build conda package (Windows) | ||
shell: powershell | ||
if: ${{ runner.os == 'Windows' }} | ||
run: | | ||
rattler-build build --recipe-dir recipes | ||
env: | ||
RATTLER_BUILD_ENABLE_GITHUB_INTEGRATION: 'true' | ||
RATTLER_BUILD_COLOR: 'always' | ||
- name: Upload build artifacts | ||
uses: actions/upload-artifact@v4 | ||
# if: ${{ inputs.upload-artifact == 'true' }} | ||
with: | ||
name: ${{ matrix.target }} | ||
path: | | ||
output/**/*.tar.bz2 | ||
output/**/*.conda | ||