-
-
Notifications
You must be signed in to change notification settings - Fork 1
100 lines (89 loc) · 2.85 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
name: Release
on:
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.26.0", "4.27.0", "5.0.0", "5.1.0", "5.2.0", "5.3.0", "5.4.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 ShortcutAsset ${{ matrix.version }}
- name: Run scripts for the code removing
run: |
bash tools/remove_code.sh ShortcutAsset ${{ matrix.unreal_engine_version }} ${{ matrix.version }} .
- name: Run scripts for the release
run: |
bash tools/replace_engine_version.sh ShortcutAsset ${{ matrix.unreal_engine_version }}
- name: Compress plugin's sources
run: |
mkdir release-plugin-${{ matrix.version }}
zip -r ShortcutAsset_UE${{ matrix.unreal_engine_version }}_${{ matrix.version }}.zip ShortcutAsset
mv ShortcutAsset_UE${{ matrix.unreal_engine_version }}_${{ matrix.version }}.zip release-plugin-${{ matrix.version }}
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: ShortcutAsset_${{ matrix.version }}
path: "release-plugin-${{ 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@v2
with:
name: SampleProject
path: "release-sample"
publish:
name: Publish
needs: [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@v2
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/ShortcutAsset_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"