-
Notifications
You must be signed in to change notification settings - Fork 4
60 lines (51 loc) · 1.78 KB
/
release.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
name: Release
on:
push:
tags:
- "v*.*.*"
branches:
- master
- develop
pull_request:
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
env:
ASSETS_FOLDER: USharpVideoSubtitles
UNITYPACKAGE: USharpVideoSubtitles_${{ github.ref_name }}.unitypackage
steps:
- uses: actions/checkout@v3
- uses: metcalfc/changelog-generator@v3.0.0
id: changelog
if: startsWith(github.ref, 'refs/tags/')
with:
myToken: ${{ secrets.GITHUB_TOKEN }}
- run: |
rm -fr "Assets/${{ env.ASSETS_FOLDER }}/Development"
echo "Assets/${{ env.ASSETS_FOLDER }}.meta" > metaList
find "Assets/${{ env.ASSETS_FOLDER }}/" -name \*.meta >> metaList
- run: |
echo "$GITHUB_REF_NAME" > "Assets/${{ env.ASSETS_FOLDER }}/version.txt"
sed -i -e "s/(dev version)/$GITHUB_REF_NAME/g" "Assets/${{ env.ASSETS_FOLDER }}/Subtitles.prefab"
if: startsWith(github.ref, 'refs/tags/')
- run: |
VERSION=$GITHUB_REF_NAME-$(git rev-parse --short "$GITHUB_SHA")
echo "$VERSION" > "Assets/${{ env.ASSETS_FOLDER }}/version.txt"
sed -i -e "s/(dev version)/$VERSION/g" "Assets/${{ env.ASSETS_FOLDER }}/Subtitles.prefab"
if: startsWith(github.ref, 'refs/heads/')
- uses: pCYSl5EDgo/create-unitypackage@v1
with:
package-path: ${{ env.UNITYPACKAGE }}
include-files: metaList
- uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
body: ${{ steps.changelog.outputs.changelog }}
files: ${{ env.UNITYPACKAGE }}
draft: true
- uses: actions/upload-artifact@v3
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
with:
name: ${{ env.UNITYPACKAGE }}
path: ${{ env.UNITYPACKAGE }}