-
Notifications
You must be signed in to change notification settings - Fork 9
46 lines (37 loc) · 1.5 KB
/
upm.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
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-events
SAMPLE_SRC_DIR: Samples
SAMPLE_DST_DIR: Samples~
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 }}'
- name: Move '${{ env.SAMPLE_SRC_DIR }}' directory to '${{ env.SAMPLE_DST_DIR }}'
run: |
rm -f '${{ env.SAMPLE_SRC_DIR }}.meta'
git mv '${{ env.SAMPLE_SRC_DIR }}' '${{ env.SAMPLE_DST_DIR }}'
git config --global user.name 'github-bot'
git config --global user.email '[email protected]'
git add '${{ env.SAMPLE_SRC_DIR }}.meta'
git add '${{ env.SAMPLE_DST_DIR }}'
git commit -m "Move '${{ env.SAMPLE_SRC_DIR }}' directory to '${{ env.SAMPLE_DST_DIR }}'"
- name: Push '${{ github.event.inputs.branch }}' branch
run: |
git push -f -u origin '${{ github.event.inputs.branch }}'