-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (54 loc) · 1.87 KB
/
create-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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 "Helika" "Thirdweb" "Plugins" "Treasure/Example" "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/output.unitypackage