-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
7 changed files
with
123 additions
and
56 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
1 change: 1 addition & 0 deletions
1
LNViewHierarchyDumper/include/LNViewHierarchyDumper/LNViewHierarchyDumper.h
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
../../LNViewHierarchyDumper/LNViewHierarchyDumper.h |
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// swift-tools-version:5.1 | ||
|
||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "LNViewHierarchyDumper", | ||
platforms: [ | ||
.iOS(.v13) | ||
], | ||
products: [ | ||
.library( | ||
name: "LNViewHierarchyDumper", | ||
type: .dynamic, | ||
targets: ["LNViewHierarchyDumper"]), | ||
.library( | ||
name: "LNViewHierarchyDumper-Static", | ||
type: .static, | ||
targets: ["LNViewHierarchyDumper"]), | ||
], | ||
dependencies: [], | ||
targets: [ | ||
.target( | ||
name: "LNViewHierarchyDumper", | ||
dependencies: [], | ||
path: "LNViewHierarchyDumper", | ||
exclude: [ | ||
"LNViewHierarchyDumper/Info.plist", | ||
"LNViewHierarchyDumper.xcodeproj" | ||
], | ||
publicHeadersPath: "include" | ||
), | ||
] | ||
) |
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 |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
if [[ -n $(git status --porcelain) ]]; then | ||
echo -e >&2 "\033[1;31mCannot release version because there are unstaged changes:\033[0m" | ||
git status --short | ||
exit -2 | ||
fi | ||
|
||
if [[ -n $(git tag --contains $(git rev-parse --verify HEAD)) ]]; then | ||
echo -e >&2 "\033[1;31mThe latest commit is already contained in the following releases:\033[0m" | ||
git tag --contains $(git rev-parse --verify HEAD) | ||
exit -3 | ||
fi | ||
|
||
# if [[ -n $(git log --branches --not --remotes) ]]; then | ||
# echo -e "\033[1;34mPushing pending commits to git\033[0m" | ||
# git push | ||
# fi | ||
|
||
CURRENT_VERSION=$(/usr/libexec/PlistBuddy LNViewHierarchyDumper/LNViewHierarchyDumper/Info.plist -c "Print CFBundleShortVersionString") | ||
NEXT_VERSION=$(echo "$CURRENT_VERSION" | perl -pe 's/^((\d+\.)*)(-?\d+)(.*)$/$1.($3+1).$4/e') | ||
|
||
echo -e "\033[1;34mUsing $NEXT_VERSION as release version\033[0m" | ||
|
||
echo -e "\033[1;34mCreating release notes\033[0m" | ||
|
||
RELEASE_NOTES_FILE=_tmp_release_notes.md | ||
|
||
touch "${RELEASE_NOTES_FILE}" | ||
open -Wn "${RELEASE_NOTES_FILE}" | ||
|
||
if ! [ -s "${RELEASE_NOTES_FILE}" ]; then | ||
echo >&2 "\033[1;31mNo release notes provided, aborting.\033[0m" | ||
rm -f "${RELEASE_NOTES_FILE}" | ||
exit -1 | ||
fi | ||
|
||
echo -e "\033[1;34mUpdating framework version\033[0m" | ||
|
||
/usr/libexec/PlistBuddy LNViewHierarchyDumper/LNViewHierarchyDumper/Info.plist -c "Set CFBundleShortVersionString $NEXT_VERSION" -c "Set CFBundleVersion 1" | ||
|
||
echo -e "\033[1;34mCommitting all changes to Git for release $NEXT_VERSION\033[0m" | ||
|
||
git add -A | ||
git commit -m "$NEXT_VERSION" | ||
git tag "$NEXT_VERSION" | ||
|
||
git push | ||
git push --tags | ||
|
||
echo -e "\033[1;34mCreating a GitHub release\033[0m" | ||
|
||
gh release create --repo LeoNatan/LNViewHierarchyDumper "$NEXT_VERSION" --title "v$NEXT_VERSION" --notes-file "${RELEASE_NOTES_FILE}" | ||
|
||
rm -f "${RELEASE_NOTES_FILE}" |