UPM #16
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: UPM | |
on: | |
workflow_dispatch: | |
inputs: | |
branch: | |
description: 'Branch' | |
required: true | |
default: 'upm' | |
jobs: | |
deploy-upm: | |
name: Deploy to UPM branch | |
runs-on: ubuntu-latest | |
env: | |
PACKAGE_DIR: Packages/com.chark.scriptable-scenes | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Create '${{ github.event.inputs.branch }}' branch from '${{ env.PACKAGE_DIR }}' directory | |
run: | | |
git branch -d '${{ github.event.inputs.branch }}' &> /dev/null || echo '${{ github.event.inputs.branch }} branch not found' | |
git subtree split -P '${{ env.PACKAGE_DIR }}' -b '${{ github.event.inputs.branch }}' | |
git checkout '${{ github.event.inputs.branch }}' | |
git push -f -u origin '${{ github.event.inputs.branch }}' | |
- name: Move 'Assets/Samples' directory to 'Samples~' | |
run: | | |
git checkout "${GITHUB_REF#refs/heads/}" -- Assets/Samples | |
mv 'Assets/Samples' 'Samples~' | |
rm -r 'Assets' | |
git add 'Samples~' | |
git commit -m 'Move samples' | |
git push -f -u origin '${{ github.event.inputs.branch }}' |