From 82433093b40d7d896284c65069d746d9456f9721 Mon Sep 17 00:00:00 2001 From: badlogic Date: Tue, 19 Nov 2019 15:01:38 +0100 Subject: [PATCH] Added spine-libgdx and spine-ts Github Actions workflows. --- .github/workflows/main.yml | 17 ----------------- .github/workflows/settings.xml | 30 ++++++++++++++++++++++++++++++ .github/workflows/spine-libgdx.yml | 24 ++++++++++++++++++++++++ .github/workflows/spine-ts.yml | 22 ++++++++++++++++++++++ spine-ts/build.sh | 20 +++++++++++++++++++- 5 files changed, 95 insertions(+), 18 deletions(-) delete mode 100644 .github/workflows/main.yml create mode 100644 .github/workflows/settings.xml create mode 100644 .github/workflows/spine-libgdx.yml create mode 100644 .github/workflows/spine-ts.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index b2340b244..000000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: CI - -on: [push] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v1 - - name: Run a one-line script - run: echo Hello, world! - - name: Run a multi-line script - run: | - echo Add other actions to build, - echo test, and deploy your project. 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/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