Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

This GitHub Action helps edit package json file to add samples from assets

License

Notifications You must be signed in to change notification settings

unbndgroup/action-npm-unity-samples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Action - Copy Asset Samples to NPM Samples~

This GitHub Action helps edit package json file to add samples from assets

Usage

Add this step in your workflow file

- name: Copy Asset Samples to NPM Samples~
  uses: unbndgroup/action-npm-unity-samples
  with:
    packageFolderName: Packages/com.thisisaura.package.example
    assetSampleFolder: Assets/Samples

Input Variables

  • packageFolderName: Folder name of Package to copy into e.g Packages/com.thisisaura.* (Optional) default to the first folder in packages.
  • assetSampleFolder: Samples Folder in Unity assets folder Assets/Samples

Unity

Prequisities

  • package.Json file within Packages/YOUR_PACKAGE_NAME/
  • Assets/Samples/YOUR_SAMPLE folder
  • Optional Assets/Samples/YOUR_SAMPLE/description.txt file
  • No folder or files under the directory Packages/YOUR_PACKAGE_NAME/Samples~

Usage

  • Within a unity package repo ensure the assets folder has Samples folder.
  • Create a new folder with the samples name under the Assets/Samples/ folder.
  • Add any sample assets and folders into the created folder.
  • Optionally Within Assets/Samples/YOUR_SAMPLE_FOLDER add a txt file named description.txt within it place any futher information for this sample within it.

What Happens

  • On merge to a packages main branch before pushing to NPM a copy of the Assets/Samples is made and moved to Packages/YOUR_PACKAGE_NAME/Samples~
  • The Packages/YOUR_PACKAGE_NAME/package.json is edited to include all Packages/YOUR_PACKAGE_NAME/Samples~ subfolder directories.
  • Packages/YOUR_PACKAGE_NAME/Samples~/YOUR_SAMPLE_FOLDER is checked for a description.txt and writes the contents into the Packages/YOUR_PACKAGE_NAME/package.json.

About

This GitHub Action helps edit package json file to add samples from assets

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published