-
-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (62 loc) · 1.94 KB
/
package.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
name: Release Package
on:
release:
types:
- published
jobs:
package:
name: Deploy release package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get previous tag
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
- name: Create release package branch
run: |
git branch -d package &> /dev/null || echo package branch not found
git subtree split -P "$PKG_ROOT" -b package
if [[ -d "Assets/Samples" ]]; then
mv "Assets/Samples" /tmp/example
fi
if [[ -f "README.md" ]]; then
mv README.md /tmp/README.md
fi
if [[ -f "LICENSE.md" ]]; then
mv LICENSE.md /tmp/LICENSE.md
fi
if [[ -f "CHANGELOG.md" ]]; then
mv CHANGELOG.md /tmp/CHANGELOG.md
fi
git checkout package
if [[ -f "/tmp/LICENSE.md" ]]; then
mv /tmp/LICENSE.md LICENSE.md
git add LICENSE.md
fi
if [[ -f "/tmp/README.md" ]]; then
mv /tmp/README.md README.md
git add README.md
fi
if [[ -f "/tmp/CHANGELOG.md" ]]; then
mv /tmp/CHANGELOG.md CHANGELOG.md
git add CHANGELOG.md
fi
if [[ -d "/tmp/example" ]]; then
mkdir "Samples~"
mv /tmp/example/* "Samples~/"
git add "Samples~"
fi
if [[ -d "Tests" ]]; then
rm -rf Tests
rm -f Tests.meta
fi
git config --global user.name 'github-bot'
git config --global user.email '[email protected]'
git commit -am "Packaged project"
git push -f -u origin package
git tag -a ${{ steps.previoustag.outputs.tag }}-upm -m "${{ steps.previoustag.outputs.tag }}"
git push origin ${{ steps.previoustag.outputs.tag }}-upm
env:
PKG_ROOT: "Packages/se.hertzole.scriptable-values"