-
Notifications
You must be signed in to change notification settings - Fork 6
65 lines (54 loc) · 2.14 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
61
62
63
64
65
name: Rlease package
on:
create:
tags:
- "*.*.*"
workflow_dispatch:
env:
packageName: "pl.krysiek.cutedancer"
packageFolder: "Packages/pl.krysiek.cutedancer"
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Replace version in files with tag
run: |
sed -i -e "s/0.0.0-dev/$GITHUB_REF_NAME/g" "${{ env.packageFolder }}/package.json"
sed -i -e "s/0.0.0-dev/$GITHUB_REF_NAME/g" "${{ env.packageFolder }}/README.txt"
sed -i -e "s/0.0.0-dev/$GITHUB_REF_NAME/g" "${{ env.packageFolder }}/Editor/Resources/CuteDancer/Views/MainView.uxml"
sed -i -e "s/0.0.0-dev/$GITHUB_REF_NAME/g" "${{ env.packageFolder }}/Editor/Data/BuildInfoData.cs"
- name: Get version
id: version
uses: notiz-dev/github-action-json-property@v0.2.0
with:
path: "Packages/${{env.packageName}}/package.json"
prop_path: "version"
- name: Set Environment Variables
run: |
echo "zipFile=${{ env.packageName }}-${{ steps.version.outputs.prop }}".zip >> $GITHUB_ENV
echo "unityPackage=${{ env.packageName }}-${{ steps.version.outputs.prop }}.unitypackage" >> $GITHUB_ENV
- name: Create Zip
uses: TheDoctor0/zip-release@0.7.1
with:
type: "zip"
directory: "Packages/${{env.packageName}}/"
filename: "../../${{env.zipFile}}" # make the zip file two directories up, since we start two directories in above
- run: find "Packages/${{env.packageName}}/" -name \*.meta >> metaList
- name: Create UnityPackage
uses: pCYSl5EDgo/create-unitypackage@v1.1.1
with:
package-path: ${{ env.unityPackage }}
include-files: metaList
- name: Make Release
uses: softprops/action-gh-release@v0.1.15
with:
tag_name: ${{ steps.version.outputs.prop }}
files: |
${{ env.zipFile }}
${{ env.unityPackage }}
Packages/${{ env.packageName }}/package.json
draft: true