-
Notifications
You must be signed in to change notification settings - Fork 6
80 lines (76 loc) · 2.77 KB
/
rattler-build.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
on:
push:
branches:
- "main"
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:
- name: Set up datetime
id: datetime
run: echo "datetime=$(date -u +'%Y%m%d%H%M%S')" >> $GITHUB_ENV
- name: Set version
id: set_version
run: |
VERSION="0.1.0dev${{ env.datetime }}"
echo "Generated version: $VERSION"
echo "version=$VERSION" >> $GITHUB_OUTPUT
rattler-build:
needs: generate_version
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 all packages
shell: bash
# do not upload on PR
if: github.event_name == 'push' && matrix.os != 'windows-latest'
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 all packages
shell: pwsh
if: github.event_name == 'push' && matrix.os == 'windows-latest'
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)"
}