11
11
outputs :
12
12
config_package : ${{ steps.config_package.outputs.configPackage }}
13
13
steps :
14
+
15
+ # Ensure that required repository variable has been created for the Package
14
16
- name : Validate Package Config
15
17
id : config_package
16
18
run : |
@@ -21,50 +23,51 @@ jobs:
21
23
fi
22
24
23
25
# Build and release the Package
26
+ # If the repository is not configured properly, this job will be skipped
24
27
build :
25
28
needs : config
26
29
runs-on : ubuntu-latest
27
30
permissions :
28
31
contents : write
29
32
env :
30
- packagePath : .
33
+ packagePath : Packages/${{ vars.PACKAGE_NAME }}
31
34
if : needs.config.outputs.config_package == 'true'
32
35
steps :
33
36
34
37
# Checkout Local Repository
35
38
- name : Checkout
36
- uses : actions/checkout@v3
39
+ uses : actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
37
40
38
41
# Get the Package version based on the package.json file
39
42
- name : Get Version
40
43
id : version
41
44
uses : zoexx/github-action-json-file-properties@b9f36ce6ee6fe2680cd3c32b2c62e22eade7e590
42
45
with :
43
- file_path : " . /package.json"
46
+ file_path : " ${{ env.packagePath }} /package.json"
44
47
prop_path : " version"
45
48
46
49
# Configure the Environment Variables needed for releasing the Package
47
50
- name : Set Environment Variables
48
51
run : |
49
- echo "zipFile=${{ vars.PACKAGE_NAME }}-${{ steps.version.outputs.value }}.zip" >> $GITHUB_ENV
52
+ echo "zipFile=${{ vars.PACKAGE_NAME }}-${{ steps.version.outputs.value }}" .zip >> $GITHUB_ENV
50
53
echo "unityPackage=${{ vars.PACKAGE_NAME }}-${{ steps.version.outputs.value }}.unitypackage" >> $GITHUB_ENV
51
54
echo "version=${{ steps.version.outputs.value }}" >> $GITHUB_ENV
52
55
53
56
# Zip the Package for release
54
57
- name : Create Package Zip
58
+ working-directory : " ${{ env.packagePath }}"
55
59
run : zip -r "${{ github.workspace }}/${{ env.zipFile }}" .
56
60
57
61
# Build a list of .meta files for future use
58
62
- name : Track Package Meta Files
59
- run : find . -name \*.meta >> metaList
63
+ run : find "${{ env.packagePath }}/" -name \*.meta >> metaList
60
64
61
65
# Make a UnityPackage version of the Package for release
62
66
- name : Create UnityPackage
63
67
uses : pCYSl5EDgo/create-unitypackage@cfcd3cf0391a5ef1306342794866a9897c32af0b
64
68
with :
65
- package-path : ./
69
+ package-path : ${{ env.unityPackage }}
66
70
include-files : metaList
67
- output-path : " ${{ github.workspace }}/${{ env.unityPackage }}" # Full path to the output file
68
71
69
72
# Make a release tag of the version from the package.json file
70
73
- name : Create Tag
80
83
files : |
81
84
${{ env.zipFile }}
82
85
${{ env.unityPackage }}
83
- . /package.json
84
- tag_name : ${{ env.version }}
86
+ ${{ env.packagePath }} /package.json
87
+ tag_name : ${{ env.version }}
0 commit comments