-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (95 loc) · 3 KB
/
release.yaml
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
name: Create Release
on:
push:
branches:
- main
- pre
- exp
- "[0-9]+.[0-9]+.[0-9]+"
- "[0-9]+.[0-9]+.x"
- "[0-9]+.x.x"
jobs:
release:
name: Release
runs-on: ubuntu-latest
outputs:
published: ${{ steps.semantic.outputs.new_release_published }}
version: ${{ steps.semantic.outputs.new_release_version }}
major_minor: ${{ steps.semantic.outputs.new_release_major_version }}.${{ steps.semantic.outputs.new_release_minor_version }}
steps:
- uses: actions/checkout@v3
with:
lfs: true
- name: Semantic Release
id: semantic
uses: cycjimmy/semantic-release-action@v2
with:
extra_plugins: |
@semantic-release/changelog
@semantic-release/git
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_REGISTRY: "https://registry.npmjs.org/"
buildPackage:
name: Build unitypackage
runs-on: ubuntu-latest
needs: release
if: needs.release.outputs.published == 'true'
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
lfs: true
- uses: actions/cache@v3
with:
path: Serially.AssetStore/Library
key: Library-build_unitypackage-Serially.AssetStore-StandaloneLinux64
restore-keys: |
Library-build_unitypackage-Serially.AssetStore-
- name: Package unitypackage
uses: game-ci/unity-builder@v2
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE_2020 }}
with:
targetPlatform: StandaloneLinux64
projectPath: Serially.AssetStore
buildMethod: UnityPackage.Build
versioning: None
allowDirtyBuild: true
- name: Move unitypackage to dist folder
run: |
mkdir dist
mv Serially.AssetStore/Serially.unitypackage dist/Serially-${{ needs.release.outputs.version }}.unitypackage
- name: Upload dist
uses: actions/upload-artifact@v2
with:
name: dist
path: dist
- name: Upload unitypackage to GitHub release
uses: svenstaro/[email protected]
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/Serially-${{ needs.release.outputs.version }}.unitypackage
tag: v${{ needs.release.outputs.version }}
buildDocs:
name: Build Docs
runs-on: ubuntu-latest
needs: release
if: needs.release.outputs.published == 'true'
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
lfs: true
- name: Build Docs
uses: nikeee/[email protected]
with:
args: .docfx/docfx.json
- name: Deploy Docs
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: _site
destination_dir: ${{ needs.release.outputs.major_minor }}