Skip to content

Commit dd95309

Browse files
committed
fix(plugins): release each ABI as a new plugin version and verify the built kit matches its label (#1380)
1 parent b87d161 commit dd95309

2 files changed

Lines changed: 31 additions & 5 deletions

File tree

.github/workflows/build-plugin.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,24 @@ jobs:
248248
./scripts/build-plugin.sh "${{ steps.plugin.outputs.target }}" arm64 "${{ steps.plugin.outputs.version }}"
249249
./scripts/build-plugin.sh "${{ steps.plugin.outputs.target }}" x86_64 "${{ steps.plugin.outputs.version }}"
250250
251+
- name: Verify built PluginKit version matches the release label
252+
run: |
253+
BUNDLE_NAME="${{ steps.plugin.outputs.bundleName }}"
254+
EXPECTED="${{ matrix.pluginKitVersion }}"
255+
WORK=$(mktemp -d)
256+
unzip -oq "build/Plugins/${BUNDLE_NAME}-arm64.zip" -d "$WORK"
257+
PLIST=$(find "$WORK" -path '*.tableplugin/Contents/Info.plist' | head -1)
258+
if [ -z "$PLIST" ]; then
259+
echo "::error::Could not find Info.plist in the built ${BUNDLE_NAME} bundle."
260+
exit 1
261+
fi
262+
ACTUAL=$(plutil -extract TableProPluginKitVersion raw "$PLIST")
263+
if [ "$ACTUAL" != "$EXPECTED" ]; then
264+
echo "::error::${BUNDLE_NAME} was built for PluginKit $ACTUAL but this release is labeled PluginKit $EXPECTED. Refusing to publish a mislabeled binary. Re-release from a commit whose plugin Info.plist matches the target PluginKit version."
265+
exit 1
266+
fi
267+
echo "Verified ${BUNDLE_NAME}: built PluginKit $ACTUAL matches the release label."
268+
251269
- name: Read checksums
252270
id: sha
253271
run: |

scripts/release-all-plugins.sh

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@
44
# Usage: ./scripts/release-all-plugins.sh <pluginKitVersion>
55
# Example: ./scripts/release-all-plugins.sh 14
66
#
7-
# Reads the latest tag for each plugin from git, pairs it with the given
8-
# pluginKitVersion, and fires one workflow_dispatch on build-plugin.yml so all
9-
# plugins build in parallel as a single matrix run.
7+
# Reads the latest tag for each plugin, bumps the patch version, and pairs the
8+
# NEW version with the given pluginKitVersion, then fires one workflow_dispatch
9+
# on build-plugin.yml so all plugins build in parallel as a single matrix run.
10+
#
11+
# An ABI bump must publish fresh binaries at a NEW release tag. Reusing the
12+
# existing tag overwrites that release's assets, which breaks the previous ABI's
13+
# consumers and serves stale copies from the GitHub release CDN.
1014
#
1115
# Prerequisites: gh CLI authenticated, run from repo root.
1216

@@ -59,16 +63,20 @@ for PLUGIN in "${PLUGINS[@]}"; do
5963
done
6064
done
6165

66+
git fetch --tags --quiet origin 2>/dev/null || true
67+
6268
TAG_LIST=""
6369
FIRST=true
64-
echo "Resolving latest tag for each plugin:"
70+
echo "Resolving next release version for each plugin (PluginKit $PKV):"
6571
for PLUGIN in "${PLUGINS[@]}"; do
6672
LATEST_TAG=$(git tag -l "plugin-${PLUGIN}-v*" | sort -V | tail -1)
6773
if [ -z "$LATEST_TAG" ]; then
6874
echo " WARNING: No tag found for plugin-${PLUGIN}-v*. Skipping."
6975
continue
7076
fi
71-
PAIR="${LATEST_TAG}:${PKV}"
77+
LATEST_VER="${LATEST_TAG#plugin-${PLUGIN}-v}"
78+
NEW_TAG="plugin-${PLUGIN}-v${LATEST_VER%.*}.$(( ${LATEST_VER##*.} + 1 ))"
79+
PAIR="${NEW_TAG}:${PKV}"
7280
if [ "$FIRST" = true ]; then
7381
TAG_LIST="$PAIR"
7482
FIRST=false

0 commit comments

Comments
 (0)