6868
6969# Update SPM
7070echo " ✍️ Updating Package.swift"
71- TEMPLATE=" $GITHUB_WORKSPACE /scripts/Package.swift.template"
71+ TEMPLATE=" $GITHUB_WORKSPACE /.buildkite/ scripts/Package.swift.template"
7272OUTPUT=" $GITHUB_WORKSPACE /$WRAPPER_REPO_DIR /Package.swift"
7373
7474library_targets=$(
@@ -100,6 +100,12 @@ envsubst < "$TEMPLATE" > "$OUTPUT"
100100cd " $GITHUB_WORKSPACE /$WRAPPER_REPO_DIR "
101101git config user.name " github-actions"
102102git config user.email " actions@github.com"
103+
104+ # Set up git credentials for push operations
105+ GIT_CREDENTIALS_FILE=$( mktemp)
106+ echo " https://x-access-token:${GIT_PAT} @github.com" > " $GIT_CREDENTIALS_FILE "
107+ git config --global credential.helper " store --file=$GIT_CREDENTIALS_FILE "
108+
103109git add Package.swift
104110
105111if ! git diff --cached --quiet; then
@@ -112,12 +118,17 @@ if ! git diff --cached --quiet; then
112118 echo " 🏷️ Creating GitHub Release $VERSION "
113119 # Requires GH CLI authenticated or GITHUB_TOKEN set
114120 if command -v gh > /dev/null 2>&1 ; then
115- gh release create " $VERSION " \
116- --title " v$VERSION " \
117- --notes " Automated release for v$VERSION "
121+ export GH_TOKEN=" $GIT_PAT "
122+ gh release create " $VERSION " \
123+ --title " v$VERSION " \
124+ --notes " Automated release for v$VERSION "
118125 else
119- echo " ⚠️ GitHub CLI (gh) not installed; skipping release creation"
126+ echo " ⚠️ GitHub CLI (gh) not installed; skipping release creation"
120127 fi
121128else
122129 echo " ℹ️ No changes in Package.swift; skipping commit/tag."
123130fi
131+
132+ # Clean up credentials
133+ git config --global --unset credential.helper
134+ rm -f " $GIT_CREDENTIALS_FILE "
0 commit comments