Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions .yamato/_preview_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,19 @@ auto-version:
- upm-ci utils auto-version commit --push
- python3 ./Tools/standalone/templates_auto_bumper.py --template-name ./com.unity.template-hd --target-dependency com.unity.render-pipelines.high-definition
- python3 ./Tools/standalone/templates_auto_bumper.py --template-name ./com.unity.template-universal --target-dependency com.unity.render-pipelines.universal
- git config --global user.name "noreply@unity3d.com"
- git config --global user.email "noreply@unity3d.com"
- git checkout master
- git add ./com.unity.template-*
- git commit -m "[Automation] Auto-bump template dependencies"
- git push origin master
- |5-

git diff --quiet
if [[ $? != 0 ]]; then
git config --global user.name "noreply@unity3d.com"
git config --global user.email "noreply@unity3d.com"
git add ./com.unity.template-*
git checkout master
git commit -m "[Automation] Auto-bump template dependencies"
git push origin master
else
echo "Did not find any dependency to bump. Will not commit and push anything."
fi
triggers:
expression: push.branch eq "master" AND NOT push.changes.all match ["*template*/**/*.json"]
artifacts:
Expand Down
20 changes: 14 additions & 6 deletions .yamato/ruamel/jobs/preview_publish/pb_auto_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from ruamel.yaml.scalarstring import DoubleQuotedScalarString as dss
from ruamel.yaml.scalarstring import PreservedScalarString as pss
from ..shared.namer import pb_job_id_auto_version
from ..shared.yml_job import YMLJob
from ..shared.constants import NPM_UPMCI_INSTALL_URL
Expand All @@ -25,12 +26,19 @@ def get_job_definition(self, agent, packages, target_branch, auto_version):
f'upm-ci utils auto-version commit --push',
f'python3 ./Tools/standalone/templates_auto_bumper.py --template-name ./com.unity.template-hd --target-dependency com.unity.render-pipelines.high-definition',
f'python3 ./Tools/standalone/templates_auto_bumper.py --template-name ./com.unity.template-universal --target-dependency com.unity.render-pipelines.universal',
f'git config --global user.name "noreply@unity3d.com"',
f'git config --global user.email "noreply@unity3d.com"',
f'git checkout {target_branch}',
f'git add ./com.unity.template-*',
f'git commit -m "[Automation] Auto-bump template dependencies"',
f'git push origin {target_branch}'])
pss(f'''
git diff --quiet
if [[ $? != 0 ]]; then
git config --global user.name "noreply@unity3d.com"
git config --global user.email "noreply@unity3d.com"
git add ./com.unity.template-*
git checkout {target_branch}
git commit -m "[Automation] Auto-bump template dependencies"
git push origin {target_branch}
else
echo "Did not find any dependency to bump. Will not commit and push anything."
fi'''
)])
job.set_trigger_on_expression(f'push.branch eq "{target_branch}" AND NOT push.changes.all match ["*template*/**/*.json"]')
job.add_artifacts_packages()
# if auto_version is True:
Expand Down