- Licensed under GNU GPL v3 or later.
- The contents of the
dist
folder are unlincensed, and are generated by ncc.
Required | Parameter | Description | Type | Default |
---|---|---|---|---|
✓ | package_path |
Path to the UnityPackage. | string |
|
✓ | icon_path |
Path to the icon file. Must be a png . |
string |
|
package_not_found_behavior |
What to do if the package file is not found. | behavior |
fail |
|
icon_not_found_behavior |
What to do if the icon file is not found. | behavior |
fail |
|
icon_already_present_behavior |
What to do if an icon is already present. | behavior |
fail |
Value | Description |
---|---|
fail |
Throws an error, stops the workflow. |
warn |
Prints a warning, skips this action. |
ignore |
Do nothing, skip this action. |
Add the following snippet to your workflow file, with the appropriate parameters:
- name: Add Icon to UnityPackage
uses: foxscore/add-icon-to-unitypackage@v1
with:
package_path: 'path/to/your/package.unitypackage'
icon_path: 'path/to/your/icon.png'
package_not_found_behavior: 'fail'
icon_not_found_behavior: 'fail'
icon_already_present_behavior: 'fail'
Assuming that you
- have a file called
icon.png
in theresources
folder.- are using the VPM Package Template, in which case the file to edit is
.github/workflows/release.yml
.
# [...]
- name: Create UnityPackage
uses: pCYSl5EDgo/create-unitypackage@cfcd3cf0391a5ef1306342794866a9897c32af0b
with:
package-path: ${{ env.unityPackage }}
include-files: metaList
# This is where we insert the action
- name: Add Icon to UnityPackage
uses: foxscore/add-icon-to-unitypackage@v1
with:
package_path: ${{ env.unityPackage }}
icon_path: 'resources/icon.png'
# end of action
- name: Make Release
uses: softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5
with:
tag_name: ${{ steps.version.outputs.prop }}
files: |
${{ env.zipFile }}
${{ env.unityPackage }}
Packages/${{ env.packageName }}/package.json