mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-27 10:51:22 +00:00
fix: run post_merge_profiles.yml after bot merges PR. (#15797)
# Description <!-- > Please provide a summary of the changes made in this PR. Include details such as: > * What issue does this PR address or fix? > * What new features or enhancements does this PR introduce? > * Are there any breaking changes or dependencies that need to be considered? --> When a PR is merged using the bot with `/bot merge`, it doesn't invoke `post_merge_profiles.yml` because post_merge_profiles.yml only starts on a push or manual dispatch. # Screenshots/Recordings/Graphs <!-- > Please attach relevant screenshots to showcase the UI changes. > Please attach images that can help explain the changes. --> ## Tests <!-- > Please describe the tests that you have conducted to verify the changes made in this PR. --> <!-- > A guide for users on how to download the artifacts from this PR. --> [How to Download Pull Requests Artifacts for Testing](https://www.orcaslicer.com/wiki/how_to_download_pr_artifacts)
This commit is contained in:
@@ -75,8 +75,6 @@ jobs:
|
|||||||
if [ -z "$base" ] || [ "$base" = "0000000000000000000000000000000000000000" ] || ! git cat-file -e "$base^{commit}" 2>/dev/null; then
|
if [ -z "$base" ] || [ "$base" = "0000000000000000000000000000000000000000" ] || ! git cat-file -e "$base^{commit}" 2>/dev/null; then
|
||||||
base="$head^"
|
base="$head^"
|
||||||
fi
|
fi
|
||||||
echo "Diffing $base..$head"
|
|
||||||
|
|
||||||
mapfile -t candidates < <(
|
mapfile -t candidates < <(
|
||||||
git diff --name-only "$base" "$head" -- resources/profiles \
|
git diff --name-only "$base" "$head" -- resources/profiles \
|
||||||
| sed -nE 's#^resources/profiles/([^/]+)/.*#\1#p; s#^resources/profiles/([^/]+)\.json$#\1#p' \
|
| sed -nE 's#^resources/profiles/([^/]+)/.*#\1#p; s#^resources/profiles/([^/]+)\.json$#\1#p' \
|
||||||
@@ -95,7 +93,6 @@ jobs:
|
|||||||
done
|
done
|
||||||
|
|
||||||
if [ "${#vendors[@]}" -eq 0 ]; then
|
if [ "${#vendors[@]}" -eq 0 ]; then
|
||||||
echo "No changed vendor profiles in this push; nothing to publish."
|
|
||||||
echo "vendors=" >> "$GITHUB_OUTPUT"
|
echo "vendors=" >> "$GITHUB_OUTPUT"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
@@ -138,13 +135,10 @@ jobs:
|
|||||||
done
|
done
|
||||||
|
|
||||||
if [ "${#unauthorized[@]}" -ne 0 ]; then
|
if [ "${#unauthorized[@]}" -ne 0 ]; then
|
||||||
echo "Changed vendor profiles are not covered by FOLDER_MERGERS: ${unauthorized[*]}"
|
|
||||||
echo "No profile caches will be published for this push."
|
|
||||||
echo "vendors=" >> "$GITHUB_OUTPUT"
|
echo "vendors=" >> "$GITHUB_OUTPUT"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf 'Changed vendors: %s\n' "${vendors[*]}"
|
|
||||||
echo "vendors=${vendors[*]}" >> "$GITHUB_OUTPUT"
|
echo "vendors=${vendors[*]}" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
- name: Resolve Orca version
|
- name: Resolve Orca version
|
||||||
@@ -163,7 +157,6 @@ jobs:
|
|||||||
# OrcaCloud keys R2 on; orca_ver (X.Y.Z) is the asset-name prefix.
|
# OrcaCloud keys R2 on; orca_ver (X.Y.Z) is the asset-name prefix.
|
||||||
echo "release_tag=$raw" >> "$GITHUB_OUTPUT"
|
echo "release_tag=$raw" >> "$GITHUB_OUTPUT"
|
||||||
echo "orca_ver=$orca_ver" >> "$GITHUB_OUTPUT"
|
echo "orca_ver=$orca_ver" >> "$GITHUB_OUTPUT"
|
||||||
echo "Orca version: release_tag=$raw asset_prefix=$orca_ver"
|
|
||||||
|
|
||||||
- name: Validate profile versions
|
- name: Validate profile versions
|
||||||
id: pver
|
id: pver
|
||||||
@@ -179,7 +172,6 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
printf '%s\t%s\n' "$v" "$pv" >> "$RUNNER_TEMP/pver.tsv"
|
printf '%s\t%s\n' "$v" "$pv" >> "$RUNNER_TEMP/pver.tsv"
|
||||||
echo "$v -> $pv"
|
|
||||||
done
|
done
|
||||||
|
|
||||||
- name: Download generate_system_cache
|
- name: Download generate_system_cache
|
||||||
@@ -214,7 +206,6 @@ jobs:
|
|||||||
pv="$(awk -F'\t' -v v="$v" '$1==v{print $2}' "$RUNNER_TEMP/pver.tsv")"
|
pv="$(awk -F'\t' -v v="$v" '$1==v{print $2}' "$RUNNER_TEMP/pver.tsv")"
|
||||||
name="${orca_ver}_${v}_${pv}_${ts}.zip"
|
name="${orca_ver}_${v}_${pv}_${ts}.zip"
|
||||||
( cd resources/profiles && zip -q -j "$out/$name" "$v.opc" )
|
( cd resources/profiles && zip -q -j "$out/$name" "$v.opc" )
|
||||||
echo "packaged $name"
|
|
||||||
done
|
done
|
||||||
echo "dir=$out" >> "$GITHUB_OUTPUT"
|
echo "dir=$out" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
|||||||
@@ -520,6 +520,28 @@ jobs:
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.warning(`Merged successfully, but dispatching build_all.yml failed: ${error.message}`);
|
core.warning(`Merged successfully, but dispatching build_all.yml failed: ${error.message}`);
|
||||||
}
|
}
|
||||||
|
// ---- re-kick the profile publish ----
|
||||||
|
// Same reason as above: post_merge_profiles.yml is push-triggered, so a
|
||||||
|
// GITHUB_TOKEN merge never starts it. workflow_dispatch skips the paths:
|
||||||
|
// filter, so only dispatch when the PR actually touched profiles.
|
||||||
|
const touchesProfiles = files.some((file) =>
|
||||||
|
[file.filename, file.previous_filename]
|
||||||
|
.filter(Boolean)
|
||||||
|
.some((p) => p.startsWith('resources/profiles/'))
|
||||||
|
);
|
||||||
|
if (touchesProfiles) {
|
||||||
|
try {
|
||||||
|
await github.rest.actions.createWorkflowDispatch({
|
||||||
|
owner,
|
||||||
|
repo,
|
||||||
|
workflow_id: 'post_merge_profiles.yml',
|
||||||
|
ref: pr.base.ref
|
||||||
|
});
|
||||||
|
core.info(`Dispatched post_merge_profiles.yml on ${pr.base.ref}.`);
|
||||||
|
} catch (error) {
|
||||||
|
core.warning(`Merged successfully, but dispatching post_merge_profiles.yml failed: ${error.message}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
label-profile:
|
label-profile:
|
||||||
# Independent of the merge rules: any PR that changes only files inside
|
# Independent of the merge rules: any PR that changes only files inside
|
||||||
|
|||||||
Reference in New Issue
Block a user