8
8
- " pixi-build-rust-v[0-9]+.[0-9]+.[0-9]+"
9
9
# Build all backends on main branch
10
10
branches : [main]
11
- pull_request :
12
11
workflow_dispatch :
13
12
14
13
15
- name : " Build and publish backends "
14
+ name : " Conda Packages "
16
15
17
16
concurrency :
18
17
group : ${{ github.workflow }}-${{ github.ref_name }}
@@ -23,36 +22,31 @@ permissions:
23
22
contents : read
24
23
25
24
jobs :
26
- generate-version :
25
+ generate-matrix :
27
26
runs-on : ubuntu-latest
28
27
outputs :
29
- version_matrix : ${{ steps.set_version.outputs.version_matrix }}
28
+ matrix : ${{ steps.set_version.outputs.matrix }}
30
29
steps :
31
30
- uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
32
- - uses : actions-rust-lang/setup-rust-toolchain@9d7e65c320fdb52dcd45ffaa68deb6c02c8754d9 # v1
33
31
- uses : prefix-dev/setup-pixi@19eac09b398e3d0c747adc7921926a6d802df4da # v0.8.8
34
- with :
35
- environments : release
36
32
- name : Extract versions
37
33
id : set_version
38
34
run : |
39
35
# extract names and versions from cargo metadata
40
36
# and generate a matrix entries for the build job
41
- MATRIX_JSON=$(pixi run python scripts/generate_version_matrix.py )
37
+ MATRIX_JSON=$(pixi run generate-matrix )
42
38
43
39
echo "Generated matrix: $MATRIX_JSON"
44
- echo "version_matrix =$MATRIX_JSON" >> $GITHUB_OUTPUT
40
+ echo "matrix =$MATRIX_JSON" >> $GITHUB_OUTPUT
45
41
46
- rattler- build :
47
- needs : generate-version
42
+ build :
43
+ needs : generate-matrix
48
44
env :
49
45
REPO_NAME : " prefix-dev/pixi-build-backends"
50
46
strategy :
51
47
matrix :
52
- bins : ${{ fromJSON(needs.generate-version.outputs.version_matrix) }}
53
-
48
+ bins : ${{ fromJSON(needs.generate-matrix.outputs.matrix) }}
54
49
fail-fast : false
55
-
56
50
runs-on : ${{ matrix.bins.os }}
57
51
steps :
58
52
- uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
@@ -71,24 +65,54 @@ jobs:
71
65
- name : Build ${{ matrix.bins.bin }}
72
66
shell : bash
73
67
env :
74
- TARGET_PLATFORM : ${{ matrix.bins.target }}
75
68
RATTLER_BUILD_ENABLE_GITHUB_INTEGRATION : " true"
76
69
RATTLER_BUILD_COLOR : " always"
77
70
run : |
78
- pixi run build-recipe-ci $RUNNER_TEMP recipe/${{ matrix.bins.bin }}.yaml ${{ env.TARGET_PLATFORM }}
79
- - name : Upload OSX or Linux packages
71
+ pixi run build-recipe-ci $RUNNER_TEMP recipe/${{ matrix.bins.bin }}.yaml ${{ matrix.bins.target }}
72
+ - name : Upload build artifacts
73
+ uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
74
+ with :
75
+ name : conda-packages-${{ matrix.bins.bin }}-${{ matrix.bins.target }}
76
+ path : ${{ runner.temp }}/**/*.conda
77
+
78
+ aggregate :
79
+ needs : build
80
+ runs-on : ubuntu-latest
81
+ strategy :
82
+ matrix :
83
+ target : [linux-64, linux-aarch64, linux-ppc64le, win-64, osx-64, osx-arm64]
84
+ steps :
85
+ - name : Download conda package artifacts for ${{ matrix.target }}
86
+ uses : actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
87
+ with :
88
+ pattern : conda-packages-*-${{ matrix.target }}
89
+ path : conda-artifacts-${{ matrix.target }}
90
+ merge-multiple : true
91
+ - name : Upload aggregated conda packages for ${{ matrix.target }}
92
+ uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
93
+ with :
94
+ name : conda-packages-${{ matrix.target }}
95
+ path : conda-artifacts-${{ matrix.target }}/**/*.conda
96
+
97
+ upload :
98
+ needs : aggregate
99
+ runs-on : ubuntu-latest
100
+ if : ${{ startsWith(github.ref, 'refs/tags') && github.repository == 'prefix-dev/pixi-build-backends' }}
101
+ steps :
102
+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
103
+ - name : Download all conda packages
104
+ uses : actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
105
+ with :
106
+ pattern : conda-packages-*
107
+ path : conda-packages
108
+ merge-multiple : true
109
+ - uses : prefix-dev/setup-pixi@ba3bb36eb2066252b2363392b7739741bb777659 # v0.8.1
110
+ with :
111
+ environments : build
112
+ - name : Upload packages
80
113
shell : bash
81
- if : ${{ startsWith(github.ref, 'refs/tags') && matrix.bins.os != 'windows-latest' && github.repository == env.REPO_NAME }}
82
114
run : |
83
- for file in "$RUNNER_TEMP"/** /*.conda; do
115
+ for file in conda-packages /*.conda; do
84
116
echo "Uploading ${file}"
85
117
pixi run -e build rattler-build upload prefix -c pixi-build-backends "$file"
86
118
done
87
- - name : Upload Windows packages
88
- shell : pwsh
89
- if : ${{ startsWith(github.ref, 'refs/tags') && matrix.bins.os == 'windows-latest' && github.repository == env.REPO_NAME }}
90
- run : |
91
- Get-ChildItem -Path $env:RUNNER_TEMP -Filter *.conda -Recurse | ForEach-Object {
92
- Write-Host "Uploading $($_.FullName)"
93
- pixi run -e build rattler-build upload prefix -c pixi-build-backends "$($_.FullName)"
94
- }
0 commit comments