Skip to content

Commit 87da444

Browse files
committed
feat: downgrade unity project, auto generate unity package
1 parent 0c58ff5 commit 87da444

16 files changed

+203
-883
lines changed

.github/workflows/release-template.yml

+36-6
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,13 @@ jobs:
2828
with:
2929
fetch-depth: 0
3030
persist-credentials: false
31+
3132
# Removes the git plugin from semantic release so it doesn't generate a new commit
3233
- name: ✂️ Disable semantic release commit
3334
if: ${{ inputs.blockReleaseCommit == true }}
3435
run: |
3536
cat .releaserc.json | jq 'del(.plugins[] | select(type == "array" and .[0] == "@semantic-release/git"))' .releaserc.json > .releaserc.json.tmp && mv .releaserc.json.tmp .releaserc.json
37+
3638
- name: 🚀 Semantic Release
3739
id: release
3840
uses: cycjimmy/semantic-release-action@v4
@@ -41,6 +43,7 @@ jobs:
4143
ci: ${{ inputs.blockPullRequestRelease }}
4244
env:
4345
GH_TOKEN: ${{ secrets.githubToken }}
46+
4447
- name: 📄 Summary
4548
run: |
4649
if [ '${{ steps.release.outputs.new_release_published }}' == 'true' ] && [ '${{ inputs.dryRun }}' == 'false' ]; then
@@ -60,29 +63,56 @@ jobs:
6063
uses: actions/checkout@v4
6164
with:
6265
fetch-depth: 0
66+
6367
- name: 📤 Extract Path
6468
id: extract-path
6569
run: |
6670
PACKAGE_PATH=$(jq -r '.plugins[] | select(type == "array" and .[0] == "@semantic-release/npm") | .[1].pkgRoot' .releaserc.json)
6771
echo "PACKAGE_PATH=$PACKAGE_PATH" >> $GITHUB_ENV
72+
73+
- name: ⚙️ Git Setup
74+
run: |
75+
git config --global user.name 'semantic-release-bot'
76+
git config --global user.email '[email protected]'
77+
6878
- name: ✏️ Update package.json
6979
run: |
7080
jq '.version = "${{ env.releaseVersion }}"' $PACKAGE_PATH/package.json > package.json.tmp && mv package.json.tmp $PACKAGE_PATH/package.json
81+
git commit --amend -a --no-edit
82+
7183
- name: 📦 Package UPM Branch
7284
id: package_upm
7385
run: |
74-
git config --global user.name 'semantic-release-bot'
75-
git config --global user.email '[email protected]'
76-
git commit --amend -a --no-edit
7786
git branch -d upm &> /dev/null || echo upm branch not found
7887
git subtree split -P "$PACKAGE_PATH" -b upm
7988
git checkout upm
80-
if [[ -d "Samples" ]]; then
81-
git mv Samples Samples~
82-
rm -f Samples.meta
89+
90+
- name: 🔄 Rename Samples Folder
91+
run: |
92+
if [[ -d "$PACKAGE_PATH/Samples" ]]; then
93+
mv "$PACKAGE_PATH/Samples" "$PACKAGE_PATH/Samples~"
94+
rm -f "$PACKAGE_PATH/Samples.meta"
8395
git commit --amend -a --no-edit
8496
fi
97+
98+
- name: 🚀 Push UPM Branch
99+
run: |
85100
git push -f -u origin upm
101+
102+
- name: 📦 Export Unity Package
103+
uses: game-ci/unity-builder@v4
104+
with:
105+
targetPlatform: StandaloneLinux64
106+
buildMethod: PackageExporter.ExportPackage
107+
env:
108+
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
109+
110+
- name: 🗂️ Upload Unity Package Artifact
111+
uses: actions/upload-artifact@v4
112+
with:
113+
name: com.mygamedevtools.scene-loader-${{ env.releaseVersion }}
114+
path: com.mygamedevtools.scene-loader.unitypackage
115+
86116
- name: 🏷️ Create UPM Tag
87117
run: |
88118
git tag $TAG upm

0 commit comments

Comments
 (0)