-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
86 lines (86 loc) · 3.26 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: rattler-build-action
description: GitHub action to build conda packages using rattler-build
author: Pavel Zwerschke
branding:
icon: package
color: yellow
inputs:
rattler-build-version:
description: Version of rattler-build to use
required: false
default: 'v0.31.1'
recipe-path:
description: Path to the recipe.yaml file
required: true
default: conda.recipe/recipe.yaml
upload-artifact:
description: whether to upload the built packages as a build artifact
required: false
default: 'true'
artifact-name:
description: Package name of the uploaded artifact
required: false
default: 'package'
build-args:
description: arguments to pass to rattler-build
required: false
default: ''
runs:
using: composite
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' || '' }}
if [ ${{ inputs.rattler-build-version }} = "latest" ]; then
url="https://github.com/prefix-dev/rattler-build/releases/latest/download/rattler-build-$arch-$platform${{ runner.os == 'Windows' && '.exe' || '' }}"
else
url="https://github.com/prefix-dev/rattler-build/releases/download/${{ inputs.rattler-build-version }}/rattler-build-$arch-$platform${{ runner.os == 'Windows' && '.exe' || '' }}"
fi
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 "${{ inputs.recipe-path }}" ${{ inputs.build-args }}
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 "${{ inputs.recipe-path }}" ${{ inputs.build-args }}
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: ${{ inputs.artifact-name }}
path: |
output/**/*.tar.bz2
output/**/*.conda