-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
30 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,9 +66,26 @@ svn update --set-depth infinity assets | |
svn update --set-depth infinity trunk | ||
svn update --set-depth immediates tags | ||
|
||
generate_zip() { | ||
if $INPUT_GENERATE_ZIP; then | ||
echo "Generating zip file..." | ||
|
||
# use a symbolic link so the directory in the zip matches the slug | ||
ln -s "${SVN_DIR}/trunk" "${SVN_DIR}/${SLUG}" | ||
zip -r "${GITHUB_WORKSPACE}/${SLUG}.zip" "$SLUG" | ||
unlink "${SVN_DIR}/${SLUG}" | ||
|
||
echo "zip-path=${GITHUB_WORKSPACE}/${SLUG}.zip" >> "${GITHUB_OUTPUT}" | ||
echo "✓ Zip file generated!" | ||
fi | ||
} | ||
|
||
# Bail early if the plugin version is already published. | ||
if [[ -d "tags/$VERSION" ]]; then | ||
echo "ℹ︎ Version $VERSION of plugin $SLUG was already published"; | ||
|
||
generate_zip | ||
|
||
exit | ||
fi | ||
|
||
|
@@ -96,6 +113,11 @@ if [[ "$BUILD_DIR" = false ]]; then | |
git config --global user.email "[email protected]" | ||
git config --global user.name "10upbot on GitHub" | ||
|
||
# Ensure git archive will pick up any changed files in the directory try. | ||
test $(git ls-files --deleted) && git rm $(git ls-files --deleted) | ||
git add . | ||
git commit -m "Include build step changes" | ||
|
||
# If there's no .gitattributes file, write a default one into place | ||
if [[ ! -e "$GITHUB_WORKSPACE/.gitattributes" ]]; then | ||
cat > "$GITHUB_WORKSPACE/.gitattributes" <<-EOL | ||
|
@@ -173,16 +195,6 @@ else | |
svn commit -m "Update to version $VERSION from GitHub" --no-auth-cache --non-interactive --username "$SVN_USERNAME" --password "$SVN_PASSWORD" | ||
fi | ||
|
||
if $INPUT_GENERATE_ZIP; then | ||
echo "Generating zip file..." | ||
|
||
# use a symbolic link so the directory in the zip matches the slug | ||
ln -s "${SVN_DIR}/trunk" "${SVN_DIR}/${SLUG}" | ||
zip -r "${GITHUB_WORKSPACE}/${SLUG}.zip" "$SLUG" | ||
unlink "${SVN_DIR}/${SLUG}" | ||
|
||
echo "zip-path=${GITHUB_WORKSPACE}/${SLUG}.zip" >> "${GITHUB_OUTPUT}" | ||
echo "✓ Zip file generated!" | ||
fi | ||
generate_zip | ||
|
||
echo "✓ Plugin deployed!" |