Last active
August 7, 2023 15:16
-
-
Save favoyang/1e281a387ec4f4f39671fe5bed39e8f5 to your computer and use it in GitHub Desktop.
GitHub actions to create the upm branch and handle "Samples" folder. https://medium.com/openupm/how-to-maintain-upm-package-part-1-7b4daf88d4c4#236a
This file contains hidden or 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: CI | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
split-upm: | |
name: split upm branch (force) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: split upm branch | |
run: | | |
git branch -d upm &> /dev/null || echo upm branch not found | |
git subtree split -P "$PKG_ROOT" -b upm | |
git checkout upm | |
if [[ -d "Samples" ]]; then | |
git mv Samples Samples~ | |
rm -f Samples.meta | |
git config --global user.name 'github-bot' | |
git config --global user.email '[email protected]' | |
git commit -am "fix: Samples => Samples~" | |
fi | |
git push -f -u origin upm | |
env: | |
PKG_ROOT: Packages/package-name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment