|
7 | 7 | description: 'Optional: Specific Slurm version to build (e.g., 24-11-5-1). Leave empty to use latest.' |
8 | 8 | required: false |
9 | 9 | default: '' |
| 10 | + # Rebuild automatically when image sources change on main |
| 11 | + push: |
| 12 | + branches: |
| 13 | + - main |
| 14 | + paths: |
| 15 | + - 'slurmctld/**' |
| 16 | + - 'slurmdbd/**' |
| 17 | + - 'slurmrestd/**' |
| 18 | + - '.github/workflows/build-push-workflow.yml' |
10 | 19 | pull_request: |
11 | 20 | branches: |
12 | 21 | - main |
@@ -37,24 +46,26 @@ jobs: |
37 | 46 | echo "✅ Using manual dispatch version override: ${{ github.event.inputs.SLURM_VERSION_OVERRIDE }}" |
38 | 47 | VERSION="${{ github.event.inputs.SLURM_VERSION_OVERRIDE }}" |
39 | 48 | else |
40 | | - echo "🔍 No version override set. Detecting latest stable version..." |
41 | | - |
42 | | - # Fetch all tags from the SchedMD/slurm repo |
43 | | - TAGS=$(curl -s https://api.github.com/repos/SchedMD/slurm/tags | jq -r '.[].name') |
| 49 | + echo "🔍 No version override set. Using newest version present in slurm-debs/..." |
44 | 50 |
|
45 | | - # Filter for stable release tags (e.g., slurm-23-11-7-1) and get the latest |
46 | | - LATEST_TAG=$(echo "$TAGS" \ |
47 | | - | grep -E '^slurm-[0-9]+-[0-9]+-[0-9]+-[0-9]+$' \ |
| 51 | + # Derive the version from the DEBs committed in this repo rather |
| 52 | + # than querying SchedMD tags: the repo can only ever build what it |
| 53 | + # has DEBs for, and this keeps push-triggered rebuilds |
| 54 | + # deterministic (a brand-new upstream tag without DEBs would |
| 55 | + # otherwise skip the build). |
| 56 | + LATEST_DEB=$(find slurm-debs -maxdepth 1 -name 'slurm-smd_*_amd64.deb' \ |
| 57 | + | sed -E 's/.*slurm-smd_([0-9]+\.[0-9]+\.[0-9]+-[0-9]+)_amd64\.deb/\1/' \ |
48 | 58 | | sort -V \ |
49 | 59 | | tail -n1) |
50 | 60 |
|
51 | | - if [ -z "$LATEST_TAG" ]; then |
52 | | - echo "❌ Could not determine the latest Slurm tag." |
| 61 | + if [ -z "$LATEST_DEB" ]; then |
| 62 | + echo "❌ Could not find any slurm-smd DEBs in slurm-debs/." |
53 | 63 | exit 1 |
54 | 64 | fi |
55 | 65 |
|
56 | | - VERSION="${LATEST_TAG#slurm-}" |
57 | | - echo "🔬 Detected latest version: $VERSION" |
| 66 | + # Convert deb version format to tag format (26.05.3-1 -> 26-05-3-1) |
| 67 | + VERSION=$(echo "$LATEST_DEB" | tr '.-' '--') |
| 68 | + echo "🔬 Newest DEB version present: $LATEST_DEB (tag format: $VERSION)" |
58 | 69 | fi |
59 | 70 | |
60 | 71 | # Convert version format for deb file matching (e.g., 24-11-5-1 -> 24.11.5-1) |
|
0 commit comments