-
Notifications
You must be signed in to change notification settings - Fork 512
190 lines (175 loc) · 6.35 KB
/
backends-release.yml
File metadata and controls
190 lines (175 loc) · 6.35 KB
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
name: "Backends - Conda Packages"
on:
workflow_dispatch:
push:
branches:
- main
paths:
- "pixi-build-backends/**"
- "crates/pixi_build_python/**"
- "crates/pixi_build_r/**"
- "crates/pixi_build_rattler_build/**"
- "crates/pixi_build_cmake/**"
- "crates/pixi_build_rust/**"
- "crates/pixi_build_mojo/**"
- ".github/workflows/backends-release.yml"
pull_request:
types:
- labeled
- synchronize
- opened
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
jobs:
build:
if: ${{ github.ref == 'refs/heads/main' || contains(github.event.pull_request.labels.*.name, 'release:backends')}}
timeout-minutes: 80
permissions:
id-token: write
contents: read
env:
REPO_NAME: "prefix-dev/pixi"
SCCACHE_GHA_ENABLED: "true"
ACTIONS_CACHE_SERVICE_V2: on
strategy:
matrix:
include:
- target: win-64
os: windows-latest
- target: osx-64
os: macos-15-intel
- target: osx-arm64
os: macos-15
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- uses: prefix-dev/setup-pixi@1b2de7f3351f171c8b4dfeb558c639cb58ed4ec0 # v0.9.5
with:
environments: backends-release
- name: Configure sccache
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
with:
script: |
core.exportVariable('ACTIONS_RESULTS_URL', process.env.ACTIONS_RESULTS_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Enable long paths (Windows)
if: matrix.os == 'windows-latest'
run: git config --global core.longpaths true
shell: bash
- name: Set package version environment variables
shell: bash
run: pixi run -e backends-release generate-versions >> $GITHUB_ENV
- name: Build all backends for ${{ matrix.target }}
shell: bash
env:
RATTLER_BUILD_ENABLE_GITHUB_INTEGRATION: "true"
RATTLER_BUILD_COLOR: "always"
run: |
pixi run -e backends-release build-backend-packages ${{ matrix.target }}
- name: Show sccache stats
shell: bash
run: pixi run -e backends-release sccache --stop-server
- name: Remove build cache
shell: bash
run: rm -rf output/build_cache
- name: Upload build artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: conda-packages-${{ matrix.target }}
path: output/**/*.conda
- name: Kill any lingering processes (Windows)
if: runner.os == 'Windows'
shell: powershell
run: |
# Kill any Python processes
Get-Process python* -ErrorAction SilentlyContinue | Stop-Process -Force
# Kill any processes from the pixi environment
$pixiPath = "${{ github.workspace }}\.pixi\envs\backends-release\bin"
Get-Process | Where-Object { $_.Path -like "$pixiPath*" } | Stop-Process -Force
# Wait a moment for handles to be released
Start-Sleep -Seconds 2
build-linux:
if: ${{ github.ref == 'refs/heads/main' || contains(github.event.pull_request.labels.*.name, 'release:backends')}}
timeout-minutes: 80
permissions:
id-token: write
contents: read
env:
REPO_NAME: "prefix-dev/pixi"
strategy:
matrix:
include:
- target: linux-64
- target: linux-aarch64
fail-fast: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- uses: prefix-dev/setup-pixi@1b2de7f3351f171c8b4dfeb558c639cb58ed4ec0 # v0.9.5
with:
environments: backends-release
- name: Set package version environment variables
shell: bash
run: pixi run -e backends-release generate-versions >> $GITHUB_ENV
- name: Build all backends for ${{ matrix.target }}
shell: bash
env:
RATTLER_BUILD_ENABLE_GITHUB_INTEGRATION: "true"
RATTLER_BUILD_COLOR: "always"
run: |
docker run --rm \
--user "$(id -u):$(id -g)" \
-v "${{ github.workspace }}:${{ github.workspace }}" \
-v "$HOME/.pixi:$HOME/.pixi" \
-v "$HOME/.cache:$HOME/.cache" \
-w "${{ github.workspace }}" \
-e HOME="$HOME" \
-e RATTLER_BUILD_ENABLE_GITHUB_INTEGRATION \
-e RATTLER_BUILD_COLOR \
-e PIXI_BUILD_CMAKE_VERSION \
-e PIXI_BUILD_MOJO_VERSION \
-e PIXI_BUILD_PYTHON_VERSION \
-e PIXI_BUILD_R_VERSION \
-e PIXI_BUILD_RATTLER_BUILD_VERSION \
-e PIXI_BUILD_RUST_VERSION \
-e PY_PIXI_BUILD_BACKEND_VERSION \
-e PIXI_BUILD_ROS_VERSION \
quay.io/pypa/manylinux2014_x86_64 \
"$HOME/.pixi/bin/pixi" run -e backends-release build-backend-packages ${{ matrix.target }}
- name: Remove build cache
shell: bash
run: rm -rf output/build_cache
- name: Upload build artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: conda-packages-${{ matrix.target }}
path: output/**/*.conda
upload:
needs: [build, build-linux]
runs-on: ubuntu-latest
if: github.repository == 'prefix-dev/pixi'
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- name: Download all conda packages
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
pattern: conda-packages-*
path: conda-packages
merge-multiple: true
run-id: ${{ github.run_id }}
- uses: prefix-dev/setup-pixi@1b2de7f3351f171c8b4dfeb558c639cb58ed4ec0 # v0.9.5
with:
environments: backends-release
- name: Upload packages
run: pixi run -e backends-release upload-packages conda-packages