-
Notifications
You must be signed in to change notification settings - Fork 1
74 lines (63 loc) · 2.3 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
66
67
68
69
70
71
72
73
74
name: Build Release
on:
workflow_dispatch:
push:
branches:
- "main"
paths:
- "package.json"
permissions:
contents: write
jobs:
build:
if: ${{ github.event.before != '0000000000000000000000000000000000000000' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get packageName
id: packageName
uses: notiz-dev/github-action-json-property@7c8cf5cc36eb85d8d287a8086a39dac59628eb31
with:
path: "package.json"
prop_path: "name"
- name: Set PackageName Variable
run: |
echo "packageName=${{steps.packageName.outputs.prop}}" >> $GITHUB_ENV
- name: Get version
id: version
uses: notiz-dev/github-action-json-property@7c8cf5cc36eb85d8d287a8086a39dac59628eb31
with:
path: "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: Move files and List targets
run: |
shopt -s extglob
mkdir -p "Packages/${{env.packageName}}"
mv !("Packages") "Packages/${{env.packageName}}/"
find "Packages/${{env.packageName}}/" -name \*.meta >> metaList
- name: Create Zip
uses: thedoctor0/zip-release@09336613be18a8208dfa66bd57efafd9e2685657
with:
type: "zip"
directory: "./Packages/${{env.packageName}}"
filename: "../../${{env.zipFile}}"
exclusions: '*.git*'
- name: Create UnityPackage
uses: pCYSl5EDgo/create-unitypackage@cfcd3cf0391a5ef1306342794866a9897c32af0b
with:
package-path: "${{env.unityPackage}}"
include-files: metaList
- name: Make Release
if: ${{ steps.version.outputs.prop != '0.0.0' }}
uses: softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5
with:
tag_name: ${{ steps.version.outputs.prop }}
files: |
${{env.zipFile}}
${{env.unityPackage}}
Packages/${{env.packageName}}/package.json