Skip to content

Commit

Permalink
ci: Remove not triggered manifest_sync workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Jan 28, 2025
1 parent 2ac7f28 commit fed3cb2
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 79 deletions.
51 changes: 0 additions & 51 deletions .github/workflows/manifest_sync.yml

This file was deleted.

28 changes: 0 additions & 28 deletions tools/ci/checkout-manifest-schema-branch.sh

This file was deleted.

41 changes: 41 additions & 0 deletions tools/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,44 @@ for tool in "${tools[@]}"; do
git checkout main
git branch -D "${tool}"
done

schema_workspace=/tmp/workspace
rm -rf -- "${schema_workspace}"
# Checkout manifest-schema branch
schema_version="$(cargo metadata --format-version=1 --no-deps | jq -r '.packages[] | select(.name == "install-action-manifest-schema") | .version')"
if [[ "${schema_version}" == "0."* ]]; then
schema_version="0.$(cut -d. -f2 <<<"${schema_version}")"
else
schema_version="$(cut -d. -f1 <<<"${schema_version}")"
fi
schema_branch="manifest-schema-${schema_version}"

git worktree add --force "${schema_workspace}"
(
cd -- "${schema_workspace}"
if git fetch origin "${schema_branch}"; then
git checkout "origin/${schema_branch}" -B "${schema_branch}"
elif ! git checkout "${schema_branch}"; then
# New branch with no history. Credit: https://stackoverflow.com/a/13969482
git checkout --orphan "${schema_branch}"
git rm -rf -- . || true
git commit -m 'Initial commit' --allow-empty
fi
)

# Copy over schema
cp -- ./manifests/* "${schema_workspace}"

(
cd -- "${schema_workspace}"
# Stage changes
git add .
# Detect changes, then commit and push if changes exist
if [[ "$(git status --porcelain=v1 | wc -l)" != "0" ]]; then
git commit -m 'Update manifest schema'
git push origin HEAD
fi
)

rm -rf -- "${schema_workspace}"
git worktree prune

0 comments on commit fed3cb2

Please sign in to comment.