Skip to content

Commit

Permalink
fix: Release packaging (#438)
Browse files Browse the repository at this point in the history
* packaging cleanup

* removed whitespace

* cleanup
  • Loading branch information
bitsandfoxes authored Nov 30, 2021
1 parent d4a124d commit df74925
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 44 deletions.
8 changes: 0 additions & 8 deletions package/Editor.meta

This file was deleted.

7 changes: 0 additions & 7 deletions package/README.md.meta

This file was deleted.

8 changes: 0 additions & 8 deletions package/Runtime.meta

This file was deleted.

7 changes: 0 additions & 7 deletions package/package.json.meta

This file was deleted.

32 changes: 18 additions & 14 deletions scripts/pack.ps1
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
New-Item "package-release" -ItemType Directory

# Copy `package-dev` stuff
Copy-Item "package-dev/*" -Destination "package-release/" -Exclude "README.md", "package.json", "Tests", "Tests.meta", "*.asmdef", "*.asmdef.meta", "SentryOptions.json*" -Recurse
$exclude = @(
"README.md",
"package.json",
"Tests",
"Tests.meta",
"*.asmdef",
"*.asmdef.meta",
"SentryOptions.json*",
"alias-references.*",
"assembly-alias.*"
)

Copy-Item "package-dev/*" "package-release/" -Exclude $exclude -Recurse

# Override with package (e.g. custom .meta files)
Copy-Item "package/*" -Destination "package-release/" -Recurse -Force

# Copy `package` stuff
Copy-Item "package/package.json" -Destination "package-release/package.json"
Copy-Item "package/README.md" -Destination "package-release/README.md"
Copy-Item "CHANGELOG.md" -Destination "package-release/CHANGELOG.md"
Copy-Item "package/CHANGELOG.md.meta" -Destination "package-release/CHANGELOG.md.meta"
Copy-Item "LICENSE.md" -Destination "package-release/LICENSE.md"
Copy-Item "package/LICENSE.md.meta" -Destination "package-release/LICENSE.md.meta"
New-Item -Type dir "package-release/Runtime/" -Force
Get-ChildItem "package/Runtime/" -Include "*.asmdef", "*.asmdef.meta" -Recurse | ForEach-Object { Copy-Item -Path $_.FullName -Destination "package-release/Runtime/" }
# Destination directory need to exist if we're copying a file instead of a directory
New-Item -Type dir "package-release/Documentation~/" -Force
Get-ChildItem "package/Documentation~/" -Include "*.md" -Recurse | ForEach-Object { Copy-Item -Path $_.FullName -Destination "package-release/Documentation~/" }

# Copy samples
Copy-Item "samples/unity-of-bugs/Assets/Scenes" -Destination "package-release/Samples~/unity-of-bugs/Assets/Scenes" -Recurse
Copy-Item "samples/unity-of-bugs/Assets/Scripts" -Destination "package-release/Samples~/unity-of-bugs/Assets/Scripts" -Recurse
Copy-Item "samples/unity-of-bugs/Assets/Scenes" -Destination "package-release/Samples~/unity-of-bugs/Scenes" -Recurse
Copy-Item "samples/unity-of-bugs/Assets/Scripts" -Destination "package-release/Samples~/unity-of-bugs/Scripts" -Recurse

# Create zip
Compress-Archive "package-release/*" -DestinationPath "package-release.zip" -Force

0 comments on commit df74925

Please sign in to comment.