Skip to content

Commit cf80828

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_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 adeb35f commit cf80828

File tree

3 files changed

+74
-98
lines changed

3 files changed

+74
-98
lines changed

.github/workflows/llvmdev_builder.yml

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

.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)