@@ -26,40 +26,51 @@ jobs:
26
26
sha : ${{ steps.commit.outputs.sha }}
27
27
steps :
28
28
- uses : actions/checkout@v2
29
- - name : before
29
+ - name : Output package.json (Before)
30
30
run : cat ${{ env.TARGET_FILE}}
31
- - name : update package.json to version ${{ env.GIT_TAG }}
31
+
32
+ - name : Update package.json to version ${{ env.GIT_TAG }}
32
33
run : sed -i -e "s/\(\"version\":\) \"\(.*\)\",/\1 \"${{ env.GIT_TAG }}\",/" ${{ env.TARGET_FILE }}
33
- - name : after
34
- run : cat ${{ env.TARGET_FILE}}
34
+
35
+ - name : Check update
36
+ id : check_update
37
+ run : |
38
+ cat ${{ env.TARGET_FILE}}
39
+ git diff --exit-code || echo "::set-output name=changed::1"
40
+
35
41
- name : Commit files
36
42
id : commit
43
+ if : steps.check_update.outputs.changed == '1'
37
44
run : |
38
45
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
39
46
git config --local user.name "github-actions[bot]"
40
47
git commit -m "feat: Update package.json to ${{ env.GIT_TAG }}" -a
41
48
echo "::set-output name=sha::$(git rev-parse HEAD)"
42
- - name : check sha
49
+
50
+ - name : Check sha
43
51
run : echo "SHA ${SHA}"
44
52
env :
45
53
SHA : ${{ steps.commit.outputs.sha }}
46
- - name : tag
54
+
55
+ - name : Create Tag
56
+ if : steps.check_update.outputs.changed == '1'
47
57
run : git tag ${{ env.GIT_TAG }}
48
- if : env.DRY_RUN == 'false'
58
+
49
59
- name : Push changes
60
+ if : env.DRY_RUN == 'false' && steps.check_update.outputs.changed == '1'
50
61
uses : ad-m/github-push-action@master
51
62
with :
52
63
github_token : ${{ secrets.GITHUB_TOKEN }}
53
64
branch : ${{ github.ref }}
54
65
tags : true
55
- if : env.DRY_RUN == 'false'
66
+
56
67
- name : Push changes (dry_run)
68
+ if : env.DRY_RUN == 'true' && steps.check_update.outputs.changed == '1'
57
69
uses : ad-m/github-push-action@master
58
70
with :
59
71
github_token : ${{ secrets.GITHUB_TOKEN }}
60
72
branch : ${{ env.DRY_RUN_BRANCH_PREFIX }}-${{ env.GIT_TAG }}
61
73
tags : false
62
- if : env.DRY_RUN == 'true'
63
74
64
75
build-dotnet :
65
76
needs : [update-packagejson]
@@ -95,35 +106,26 @@ jobs:
95
106
unity : ["2019.3.9f1"]
96
107
include :
97
108
- unity : 2019.3.9f1
98
- license : UNITY_2019_3
109
+ license : UNITY_LICENSE_2019
99
110
runs-on : ubuntu-latest
100
111
timeout-minutes : 15
101
- container :
102
- # with linux-il2cpp. image from https://hub.docker.com/r/gableroux/unity3d/tags
103
- image : gableroux/unity3d:${{ matrix.unity }}-linux-il2cpp
104
112
steps :
105
- # Ubuntu 18.04 git is too old, use ppa latest git.
106
- - run : |
107
- apt-get update && apt-get install --no-install-recommends -y software-properties-common && add-apt-repository -y ppa:git-core/ppa
108
- apt-get update && apt-get install --no-install-recommends -y git
109
113
- uses : actions/checkout@v2
110
114
with :
111
115
ref : ${{ needs.update-packagejson.outputs.sha }}
112
- # activate Unity from manual license file(ulf)
113
- - run : echo -n "$UNITY_LICENSE" >> .Unity.ulf
114
- env :
115
- UNITY_LICENSE : ${{ secrets[matrix.license] }}
116
- - run : /opt/Unity/Editor/Unity -quit -batchmode -nographics -silent-crashes -logFile -manualLicenseFile .Unity.ulf || exit 0
117
-
118
- # set release tag(*.*.*) to env.GIT_TAG
119
- - run : echo "GIT_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
120
-
121
116
# Execute scripts: Export Package
117
+ # /opt/Unity/Editor/Unity -quit -batchmode -nographics -silent-crashes -logFile -projectPath . -executeMethod PackageExporter.Export
122
118
- name : Export unitypackage
123
- run : /opt/Unity/Editor/Unity -quit -batchmode -nographics -silent-crashes -logFile -projectPath . -executeMethod PackageExporter.Export
124
- working-directory : src/ZString.Unity
119
+
125
120
env :
121
+ UNITY_LICENSE : ${{ secrets[matrix.license] }}
126
122
UNITY_PACKAGE_VERSION : ${{ env.GIT_TAG }}
123
+ with :
124
+ projectPath : src/ZString.Unity
125
+ unityVersion : ${{ matrix.unity }}
126
+ targetPlatform : StandaloneLinux64
127
+ buildMethod : PackageExporter.Export
128
+ versioning : None
127
129
128
130
- name : check all .meta is commited
129
131
run : |
0 commit comments