-
-
Notifications
You must be signed in to change notification settings - Fork 30
137 lines (122 loc) · 3.81 KB
/
release.yaml
File metadata and controls
137 lines (122 loc) · 3.81 KB
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
125
126
127
128
129
130
131
132
133
134
135
136
137
name: Release
on:
workflow_dispatch:
push:
branches:
- main
- 'release/v**'
- 'run-ci/**'
tags:
- 'v*'
pull_request:
jobs:
plugin-pack:
name: Pack plugin sources
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
unreal_engine_version:
[
"4.27.0",
"5.0.0", "5.1.0", "5.2.0", "5.3.0", "5.4.0", "5.5.0", "5.6.0", "5.7.0"
]
version:
["free", "full"]
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Run scripts for the license removing
run: |
bash tools/remove_license.sh Kdtree ${{ matrix.version }}
- name: Run scripts for the code removing
run: |
bash tools/remove_code.sh Kdtree ${{ matrix.unreal_engine_version }} ${{ matrix.version }} .
- name: Run scripts for the release
run: |
bash tools/replace_engine_version.sh Kdtree ${{ matrix.unreal_engine_version }}
- name: Compress plugin's sources
run: |
mkdir release-plugin-${{ matrix.version }}
zip -r Kdtree_UE${{ matrix.unreal_engine_version }}_${{ matrix.version }}.zip Kdtree
mv Kdtree_UE${{ matrix.unreal_engine_version }}_${{ matrix.version }}.zip release-plugin-${{ matrix.version }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: Kdtree_${{ matrix.unreal_engine_version }}_${{ matrix.version }}
path: "release-plugin-${{ matrix.version }}"
merge-plugin-pack:
name: Merge packed plugins
runs-on: ubuntu-latest
needs: [plugin-pack]
strategy:
fail-fast: false
matrix:
version:
["free", "full"]
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
pattern: Kdtree_*_${{ matrix.version }}
merge-multiple: true
path: dist
- name: Move artifacts
run: |
mkdir release-plugin-${{ matrix.version }}
mv dist/Kdtree_*_${{ matrix.version }}.zip release-plugin-${{ matrix.version }}
- name: Updload artifacts
uses: actions/upload-artifact@v4
with:
name: Kdtree_${{ matrix.version }}
path: "release-plugin-${{ matrix.version }}"
- name: Delete unused artifacts
uses: geekyeggo/delete-artifact@v5
with:
name: Kdtree_*_${{ matrix.version }}
sample-pack:
name: Pack sample sources
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Compress sample project's sources
run: |
mkdir release-sample
cd samples && zip -r SampleProject.zip SampleProject && cd ..
mv samples/SampleProject.zip release-sample
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: SampleProject
path: "release-sample"
publish:
name: Publish
needs: [merge-plugin-pack, sample-pack]
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Fetch Artifacts
uses: actions/download-artifact@v4
with:
path: dist
- name: Install hub command
run: |
sudo apt update
sudo apt install -y hub
- name: Create Release
env:
GITHUB_TOKEN: ${{ secrets.TOKEN_FOR_ACTIONS }}
run: |
set -x
assets=()
for asset in dist/Kdtree_free/*.zip; do
assets+=("-a" "$asset")
done
for asset in dist/SampleProject/*.zip; do
assets+=("-a" "$asset")
done
tag_name="${GITHUB_REF##*/}"
hub release create "${assets[@]}" -m "$tag_name" "$tag_name"