-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (71 loc) · 2.27 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
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
SelfHosted-Publish:
needs: update-and-tag
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: upm
- uses: actions/setup-node@v3
with:
node-version: '20.x'
registry-url: ${{ secrets.NPM_SERVER }}
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
GitHub-Publish:
needs: update-and-tag
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- uses: actions/checkout@v4
with:
ref: upm
- uses: actions/setup-node@v3
with:
node-version: '20.x'
- uses: FrontEndDev-org/publish-node-package-action@v1
with:
target: github