-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (42 loc) · 1.5 KB
/
UPMBranchUpdate.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
47
48
49
50
51
52
53
name: Update and Publish UPM Branch
on:
push:
branches:
- main
jobs:
update-and-tag:
runs-on: ubuntu-latest
steps:
- name: Set Git Config
run: |
git config --global user.email "tazimtazim2012@gmail.com"
git config --global user.name "Warhammer4000"
- name: Checkout Repository
uses: actions/checkout@v2
- name: Find package.json
id: find-package-json
run: echo ::set-output name=package-json-path::$(find . -name "package.json" | head -n 1)
- name: Get Package Name from package.json
id: get-package-name
run: echo ::set-output name=package-name::$(jq -r .name ${{ steps.find-package-json.outputs.package-json-path }})
- name: Get Version from package.json
id: get-version
run: echo ::set-output name=version::$(jq -r .version ${{ steps.find-package-json.outputs.package-json-path }})
- name: Git Subtree Split
run: git subtree split -P Assets/Packages/${{ steps.get-package-name.outputs.package-name }}/ -b upm
- name: Rename Samples
run: |
git checkout upm
if [[ -d "Samples" ]]; then
git mv Samples Samples~
rm -f Samples.meta
git commit -am "fix: Samples => Samples~"
fi
- name: Create Git Tag
if: steps.get-version.outputs.version != ''
run: git tag v${{ steps.get-version.outputs.version }} upm
- name: Push Tags
run: |
git checkout upm
git push -f -u origin upm
git push --tags