diff --git a/.github/workflows/settings.xml b/.github/workflows/settings.xml
new file mode 100644
index 000000000..b5a32b3dc
--- /dev/null
+++ b/.github/workflows/settings.xml
@@ -0,0 +1,30 @@
+
+
+
+
+ sonatype-nexus-snapshots
+ ${env.SONATYPE_USER}
+ ${env.SONATYPE_PASSWORD}
+
+
+ sonatype-nexus-staging
+ ${env.SONATYPE_USER}
+ ${env.SONATYPE_PASSWORD}
+
+
+
+
+
+ gpg
+
+ gpg
+ ${env.GPG_PASSWORD}
+
+
+
+
+ gpg
+
+
\ No newline at end of file
diff --git a/.github/workflows/spine-libgdx.yml b/.github/workflows/spine-libgdx.yml
new file mode 100644
index 000000000..9e1b8c78d
--- /dev/null
+++ b/.github/workflows/spine-libgdx.yml
@@ -0,0 +1,24 @@
+name: Build spine-libgdx
+
+on:
+ push:
+ paths:
+ - 'spine-libgdx/**'
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v1
+ - name: Set up JDK 1.7
+ uses: actions/setup-java@v1
+ with:
+ java-version: 1.7
+ - name: Build spine-libgdx
+ working-directory: spine-libgdx/spine-libgdx
+ env:
+ SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
+ SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
+ run: mvn -s ../../.github/workflows/settings.xml clean deploy
diff --git a/.github/workflows/spine-ts.yml b/.github/workflows/spine-ts.yml
new file mode 100644
index 000000000..aa55d83be
--- /dev/null
+++ b/.github/workflows/spine-ts.yml
@@ -0,0 +1,22 @@
+name: Build spine-ts
+
+on:
+ push:
+ paths:
+ - 'spine-ts/**'
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v1
+ - name: Setup TypeScript
+ uses: actions/setup-node@v1
+ with:
+ node-version: '13.x'
+ - run: npm install -g typescript
+ - name: Build spine-ts
+ working-directory: spine-ts
+ env:
+ TS_UPDATE_URL: ${{secrets.TS_UPDATE_URL}}
+ run: ./build.sh
\ No newline at end of file
diff --git a/spine-ts/README.md b/spine-ts/README.md
index 06bd17d8c..21d1926c0 100644
--- a/spine-ts/README.md
+++ b/spine-ts/README.md
@@ -1,4 +1,4 @@
-# spine-ts
+ # spine-ts
The spine-ts runtime provides functionality to load and manipulate [Spine](http://esotericsoftware.com) skeletal animation data using TypeScript and JavaScript. spine-ts is split
up into multiple modules:
diff --git a/spine-ts/build.sh b/spine-ts/build.sh
index 5556be95f..5b9ff093b 100755
--- a/spine-ts/build.sh
+++ b/spine-ts/build.sh
@@ -1,5 +1,14 @@
#!/bin/sh
-set -e -x
+set -e
+
+if [ -z "$GITHUB_REF" ];
+then
+ BRANCH=$(git symbolic-ref --short -q HEAD)
+else
+ BRANCH=${GITHUB_REF#refs/heads/}
+fi
+
+echo "Building spine-ts $BRANCH artifacts"
tsc -p tsconfig.json
tsc -p tsconfig.core.json
tsc -p tsconfig.webgl.json
@@ -7,3 +16,12 @@ tsc -p tsconfig.canvas.json
tsc -p tsconfig.threejs.json
tsc -p tsconfig.player.json
ls build/*.js build/*.ts | awk '{print "unexpand -t 4 ", $0, " > /tmp/e; mv /tmp/e ", $0}' | sh
+
+if ! [ -z "$TS_UPDATE_URL" ] && ! [ -z "$BRANCH" ];
+then
+ echo "Deploying spine-ts $BRANCH artifacts"
+ zip -j spine-ts.zip build/* player/css/spine-player.css player/example/external/*
+ curl -F "file=@spine-ts.zip" "$TS_UPDATE_URL$BRANCH"
+else
+ echo "Not deploying artifacts. TS_UPDATE_URL and/or BRANCH not set."
+fi
\ No newline at end of file
diff --git a/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonAnimationComponent.cpp b/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonAnimationComponent.cpp
index 21f91fbbf..d996c33a7 100644
--- a/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonAnimationComponent.cpp
+++ b/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonAnimationComponent.cpp
@@ -40,8 +40,8 @@ void UTrackEntry::SetTrackEntry(TrackEntry* trackEntry) {
void callback(AnimationState* state, spine::EventType type, TrackEntry* entry, Event* event) {
USpineSkeletonAnimationComponent* component = (USpineSkeletonAnimationComponent*)state->getRendererObject();
-
- if (entry->getRendererObject()) {
+
+ if (entry->getRendererObject()) {
UTrackEntry* uEntry = (UTrackEntry*)entry->getRendererObject();
if (type == EventType_Start) {
component->AnimationStart.Broadcast(uEntry);
@@ -70,7 +70,7 @@ void callback(AnimationState* state, spine::EventType type, TrackEntry* entry, E
uEntry->SetTrackEntry(nullptr);
component->GCTrackEntry(uEntry);
}
- }
+ }
}
USpineSkeletonAnimationComponent::USpineSkeletonAnimationComponent () {
@@ -154,7 +154,7 @@ void USpineSkeletonAnimationComponent::CheckState () {
}
}
-void USpineSkeletonAnimationComponent::DisposeState () {
+void USpineSkeletonAnimationComponent::DisposeState () {
if (state) {
delete state;
state = nullptr;
@@ -225,14 +225,14 @@ UTrackEntry* USpineSkeletonAnimationComponent::SetAnimation (int trackIndex, FSt
trackEntries.Add(uEntry);
return uEntry;
} else return NewObject();
-
+
}
UTrackEntry* USpineSkeletonAnimationComponent::AddAnimation (int trackIndex, FString animationName, bool loop, float delay) {
CheckState();
if (state && skeleton->getData()->findAnimation(TCHAR_TO_UTF8(*animationName))) {
state->disableQueue();
- TrackEntry* entry = state->addAnimation(trackIndex, TCHAR_TO_UTF8(*animationName), loop, delay);
+ TrackEntry* entry = state->addAnimation(trackIndex, TCHAR_TO_UTF8(*animationName), loop, delay);
state->enableQueue();
UTrackEntry* uEntry = NewObject();
uEntry->SetTrackEntry(entry);
@@ -265,7 +265,7 @@ UTrackEntry* USpineSkeletonAnimationComponent::AddEmptyAnimation (int trackIndex
UTrackEntry* USpineSkeletonAnimationComponent::GetCurrent (int trackIndex) {
CheckState();
- if (state) {
+ if (state && state->getCurrent(trackIndex)) {
TrackEntry* entry = state->getCurrent(trackIndex);
if (entry->getRendererObject()) {
return (UTrackEntry*)entry->getRendererObject();
diff --git a/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineWidget.cpp b/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineWidget.cpp
index 95bc24e2c..64357a7db 100644
--- a/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineWidget.cpp
+++ b/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineWidget.cpp
@@ -436,7 +436,7 @@ UTrackEntry* USpineWidget::AddEmptyAnimation(int trackIndex, float mixDuration,
UTrackEntry* USpineWidget::GetCurrent(int trackIndex) {
CheckState();
- if (state) {
+ if (state && state->getCurrent(trackIndex)) {
TrackEntry* entry = state->getCurrent(trackIndex);
if (entry->getRendererObject()) {
return (UTrackEntry*)entry->getRendererObject();