Skip to content

Commit

Permalink
feat: Update script to be compatible with github action
Browse files Browse the repository at this point in the history
  • Loading branch information
PereViader committed May 18, 2024
1 parent 494ad39 commit 1e3d2ea
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 18 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/PublishUnity3dPackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ jobs:
cd UnityPackageRelease
npm pack
# - name: Create github release
# uses: softprops/action-gh-release@v2
# with:
# name: PereViader.Utils.Unity3d ${{ steps.get-version.outputs.version }}
# files: |
# UnityPackageRelease/com.pereviader.utils.unity3d-${{ steps.get-version.outputs.version }}.tgz
- name: Create github release
uses: softprops/action-gh-release@v2
with:
tag_name: Unity3d/${{ steps.get-version.outputs.version }}
name: PereViader.Utils.Unity3d ${{ steps.get-version.outputs.version }}
files: |
UnityPackageRelease/com.pereviader.utils.unity3d-${{ steps.get-version.outputs.version }}.tgz
24 changes: 13 additions & 11 deletions PereViader.Utils.Unity3d/Assets/Tools/GenerateUnity3dMetas.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ traverse_and_generate() {
local dir="$1"
for item in "$dir"/*; do
# Skip if the item is a .meta file
if [[ "$item" == *.meta ]]; then
continue
fi
case "$item" in
*.meta) continue ;;
esac

# Check if a .meta file already exists, skip if it does
if [ -f "$item.meta" ]; then
Expand All @@ -72,21 +72,23 @@ traverse_and_generate() {

# Check for directories and skip those ending with ~
if [ -d "$item" ]; then
if [[ "$item" == *~ ]]; then
continue
fi
case "$item" in
*~) continue ;;
esac
echo "Generating .meta for directory: $item"
generate_folder_meta "$item"
traverse_and_generate "$item" # Recursive call for subdirectories
continue
fi

# Generate .meta for .cs files
if [ "$item" == *.cs ]; then
echo "Generating .meta for script: $item"
generate_cs_meta "$item"
continue
fi
case "$item" in
*.cs)
echo "Generating .meta for script: $item"
generate_cs_meta "$item"
continue
;;
esac

# Generate .meta for non-.cs files
echo "Generating .meta for other file: $item"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ echo Copy generator dll to package
cp "PereViader.Utils.Common/PereViader.Utils.Common.Generators/bin/Release/netstandard2.0/PereViader.Utils.Common.Generators.dll" "UnityPackageRelease/PereViader.Utils.Common.Generators.dll"

echo Generating meta for PereViader.Utils.Common.Generators.dll
cp "PereViader.Utils.Unity3d/Assets/Tools/Meta~/PereViader.Utils.Common.Generators.dll.meta" "UnityPackageRelease/PereViader.Utils.Common.Generators.dll"
cp "PereViader.Utils.Unity3d/Assets/Tools/Meta~/PereViader.Utils.Common.Generators.dll.meta" "UnityPackageRelease/PereViader.Utils.Common.Generators.dll.meta"

0 comments on commit 1e3d2ea

Please sign in to comment.