Skip to content

Commit db0de23

Browse files
committed
Refactor package build workflow
* Merge llvmdev_win_builder.yml + llvmdev_win-64_conda_builder.yml into one to avoid code duplication * Add input parameter to be able to select between recipes to build * Rename flow to llvmdev_conda_builder.yml as it contains nothing specific to windows and the code is just a generic conda package builder * Add ${{ matrix.recipe }}-${{ runner.os }} to upload name to better differentiate artifacts * Remove "x" from `bash -elx {0}` as that pollutes the Action log due to the implicit `source "$CONDA/etc/profile.d/conda.sh` calls in every step. * Set `run-post: false` to avoid setup-miniconda cleaning up the Github Action VM as that is wiped after the run anyways * Run the flow if it gets changed in PRs, to see a public verfication that the changes are actually working
1 parent 0924039 commit db0de23

File tree

4 files changed

+66
-147
lines changed

4 files changed

+66
-147
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: llvmdev_builder
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- .github/workflows/llvmdev_conda_builder.yml
7+
workflow_dispatch:
8+
9+
concurrency:
10+
# Concurrency group that uses the workflow name and PR number if available
11+
# or commit SHA as a fallback. If a new build is triggered under that
12+
# concurrency group while a previous build is running it will be canceled.
13+
# Repeated pushes to a PR will cancel all previous builds, while multiple
14+
# merges to master will not cancel.
15+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
20+
windows:
21+
runs-on: ${{ matrix.os }}
22+
defaults:
23+
run:
24+
shell: bash -el {0}
25+
strategy:
26+
matrix:
27+
os: [ubuntu-24.04,ubuntu-24.04-arm,macos-13,macos-14,windows-2019]
28+
recipe: ['llvmdev', 'llvmdev_manylinux']
29+
30+
steps:
31+
- name: Clone repository
32+
uses: actions/checkout@v4
33+
34+
- name: Setup Miniconda
35+
uses: conda-incubator/setup-miniconda@v3
36+
with:
37+
auto-update-conda: true
38+
auto-activate-base: true
39+
activate-environment: ""
40+
41+
- name: Install conda-build
42+
run: |
43+
conda install conda-build
44+
45+
- name: Build conda package
46+
env:
47+
CONDA_CHANNEL_DIR: conda_channel_dir
48+
run: |
49+
mkdir $CONDA_CHANNEL_DIR
50+
conda build ./conda-recipes/${{ matrix.recipe }} --output-folder=$CONDA_CHANNEL_DIR
51+
ls -lah $CONDA_CHANNEL_DIR
52+
53+
- name: Upload conda package
54+
uses: actions/upload-artifact@v4
55+
with:
56+
name: ${{ matrix.recipe }}-${{ runner.os }}
57+
path: conda_channel_dir
58+
compression-level: 0
59+
retention-days: 7
60+
if-no-files-found: error
61+
run-post: false
62+
63+
- name: Get Workflow Run ID
64+
run: |
65+
echo "Current workflow run ID: ${{ github.run_id }}"
66+
echo "Use this ID when triggering llvmlite workflow"

.github/workflows/llvmdev_linux-64_conda_builder.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.

.github/workflows/llvmdev_win-64_conda_builder.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.

.github/workflows/llvmdev_win_builder.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.

0 commit comments

Comments
 (0)