-
Notifications
You must be signed in to change notification settings - Fork 2
124 lines (118 loc) · 4.79 KB
/
deploy.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
name: Deploy
on:
workflow_dispatch:
inputs:
package_version:
description: 'Package version'
required: true
default: '1.0.0'
jobs:
pack-unitypackage:
runs-on: ubuntu-20.04
name: Unity Package Pack
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: unity_develop
fetch-depth: 0
token: ${{ secrets.FG_L_PAT_3 }}
submodules: recursive
- name: Find all meta files
run: |
ls -l
mkdir Assets
mkdir $PKG_ROOT
git mv AnchorLinkSharp $PKG_ROOT
git mv AnchorLinkSharp.meta $PKG_ROOT
git mv AnchorLinkTransportSharp $PKG_ROOT
git mv AnchorLinkTransportSharp.meta $PKG_ROOT
git mv EosioSigningRequestSharp $PKG_ROOT
git mv EosioSigningRequestSharp.meta $PKG_ROOT
git mv README.md $PKG_ROOT
git mv README.md.meta $PKG_ROOT
git mv AnchorLinkSharp.asmdef $PKG_ROOT
git mv AnchorLinkSharp.asmdef.meta $PKG_ROOT
find $PKG_ROOT/ -name \*.meta >> metaList
env:
PKG_ROOT: Assets/AnchorLinkSharp
- name: Make directory for our unity package
run: mkdir a
- name: Create Unity Package
uses: pCYSl5EDgo/create-unitypackage@master
with:
package-path: 'a/anchorlinksharp.unitypackage'
include-files: metaList
- name: Upload package
uses: actions/upload-artifact@v1
with:
name: a
path: ./a
release:
runs-on: ubuntu-20.04
needs: pack-unitypackage
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Determine version
run: echo "VERSION=$(git describe --tags --dirty)" >> $GITHUB_ENV
- name: Create Release
id: create_release
uses: ncipollo/[email protected]
with:
tag: ${{ github.event.inputs.package_version }}
name: Release ${{ github.event.inputs.package_version }}
body: ${{ github.event.inputs.package_version }}
makeLatest: true
- name: Download unity package
uses: actions/download-artifact@v1
with:
name: a
path: ./a
- name: Upload unity package to release
uses: Fhwang0926/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_name: a/anchorlinksharp.unitypackage # path + filename
split-upm:
needs: release
name: Split UPM branch
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: unity_develop
fetch-depth: 0
token: ${{ secrets.FG_L_PAT_3 }}
submodules: recursive
- name: split upm branch
run: |
git branch -d upm &> /dev/null || echo upm branch not found # recreate the upm branch each time
echo "********************** ROOT **********************"
ls
git config --global user.name 'github-bot'
git config --global user.email '[email protected]'
git checkout -b upm # checkout the branch
git subtree add --prefix=temp/AnchorLinkTransportSharp AnchorLinkTransportSharp $(git rev-parse HEAD:AnchorLinkTransportSharp)
git subtree add --prefix=temp/EosioSigningRequestSharp EosioSigningRequestSharp $(git rev-parse HEAD:EosioSigningRequestSharp)
git rm .gitmodules
git rm -rf AnchorLinkTransportSharp
git rm -rf EosioSigningRequestSharp
git add .
git rm -r .github || true
git commit -am "removed submodules and merged them to upm"
mkdir AnchorLinkTransportSharp
mkdir EosioSigningRequestSharp
cp -r temp/AnchorLinkTransportSharp/. AnchorLinkTransportSharp
cp -r temp/EosioSigningRequestSharp/. EosioSigningRequestSharp
git rm -rf temp
git rm -r .github || true
git add .
git commit -m "rearraged the files to their correct folder"
git mv AnchorLinkTransportSharp/Examples AnchorLinkTransportSharp/Samples~
git rm AnchorLinkTransportSharp/Examples.meta
git commit -am "renamed examples to samples~"
git push -u origin upm --force # commit the branch