v2.0.0 release (#120) #8
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
name: Create Unity Package | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Get version | |
id: version | |
run: | | |
echo "TAG_NAME=v$(sed -n 's/.*version = "\([^"]*\)".*/\1/p' Assets/Treasure/TDK/Runtime/TDKVersion.cs)" >> $GITHUB_OUTPUT | |
- name: Get existing release | |
id: existing-release | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
echo "STATUS=$(gh release view ${{steps.version.outputs.TAG_NAME}} --json isDraft)" >> $GITHUB_OUTPUT | |
- name: Select files | |
run: | | |
for folder in "Plugins" "Thirdweb" "Treasure/Example" "Treasure/Plugins" "Treasure/TDK" | |
do | |
echo "Assets/$folder.meta" >> metaList | |
find "Assets/$folder" -name \*.meta >> metaList | |
done | |
for file in "link.xml" "csc.rsp" | |
do | |
echo "Assets/$file.meta" >> metaList | |
done | |
- name: Make output folder | |
run: mkdir out | |
- name: Create unitypackage | |
uses: pCYSl5EDgo/create-unitypackage@b5c57408698b1fab8b3a84d4b67f767b8b7c0be9 # v1.2.3 | |
with: | |
package-path: 'out/tdk-unity_${{steps.version.outputs.TAG_NAME}}_Full.unitypackage' | |
include-files: metaList | |
- name: Upload unitypackage artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
path: out | |
name: package | |
- name: Release | |
uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 # v2.0.8 | |
# do not override an exising release if its already published | |
if: ${{ !contains(steps.existing-release.outputs.STATUS, '"isDraft":false')}} | |
with: | |
draft: true | |
tag_name: ${{ steps.version.outputs.TAG_NAME }} | |
files: | | |
out/tdk-unity_${{steps.version.outputs.TAG_NAME}}_Full.unitypackage |