mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 09:16:01 +08:00
Temp pipeline to build latest commit and deploy latest commit.
This commit is contained in:
parent
51ad987724
commit
62e91b3ede
22
.github/workflows/spine-construct3-temp.yml
vendored
Normal file
22
.github/workflows/spine-construct3-temp.yml
vendored
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
name: Build spine-construct3-temp
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- "spine-ts/spine-construct3/**"
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Setup TypeScript
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: "16"
|
||||||
|
- name: Build spine-construct3
|
||||||
|
working-directory: spine-ts
|
||||||
|
env:
|
||||||
|
C3_UPDATE_URL: ${{secrets.C3_UPDATE_URL}}
|
||||||
|
run: ./spine-construct3/build.sh
|
||||||
66
spine-ts/spine-construct3/build.sh
Executable file
66
spine-ts/spine-construct3/build.sh
Executable file
@ -0,0 +1,66 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
|
# Source logging utilities
|
||||||
|
source ../../formatters/logging/logging.sh
|
||||||
|
|
||||||
|
if [ -z "$GITHUB_REF" ]; then
|
||||||
|
BRANCH=$(git symbolic-ref --short -q HEAD)
|
||||||
|
else
|
||||||
|
BRANCH=${GITHUB_REF#refs/heads/}
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Get the latest commit message
|
||||||
|
COMMIT_MSG=$(git log -1 --pretty=%B)
|
||||||
|
|
||||||
|
log_title "Spine-Construct3 Build"
|
||||||
|
log_detail "Branch: $BRANCH"
|
||||||
|
|
||||||
|
log_action "Installing dependencies"
|
||||||
|
pushd ".." > /dev/null
|
||||||
|
if npm install > /tmp/npm-install.log 2>&1; then
|
||||||
|
log_ok
|
||||||
|
else
|
||||||
|
log_fail
|
||||||
|
log_error_output "$(cat /tmp/npm-install.log)"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
popd > /dev/null
|
||||||
|
|
||||||
|
# Public only if the commit message is in the correct format
|
||||||
|
if ! [ -z "$C3_UPDATE_URL" ] && ! [ -z "$BRANCH" ];
|
||||||
|
then
|
||||||
|
log_action "Creating artifacts zip"
|
||||||
|
pushd "dist" > /dev/null
|
||||||
|
if ZIP_OUTPUT=$(zip -r ../EsotericSoftware_SpineConstruct3.c3addon ./* 2>&1); then
|
||||||
|
log_ok
|
||||||
|
popd > /dev/null
|
||||||
|
if ZIP_OUTPUT=$(zip spine-construct3.zip EsotericSoftware_SpineConstruct3.c3addon 2>&1); then
|
||||||
|
log_ok
|
||||||
|
else
|
||||||
|
log_fail
|
||||||
|
log_error_output "$ZIP_OUTPUT"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
log_fail
|
||||||
|
log_error_output "$ZIP_OUTPUT"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
log_action "Uploading to $C3_UPDATE_URL$BRANCH"
|
||||||
|
if CURL_OUTPUT=$(curl -f -F "file=@spine-construct3.zip" "$C3_UPDATE_URL$BRANCH" 2>&1); then
|
||||||
|
log_ok
|
||||||
|
else
|
||||||
|
log_fail
|
||||||
|
log_error_output "$CURL_OUTPUT"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
log_summary "✓ Build and deployment successful"
|
||||||
|
else
|
||||||
|
log_skip "Deployment skipped (C3_UPDATE_URL and/or BRANCH not set)"
|
||||||
|
log_summary "✓ Build successful"
|
||||||
|
fi
|
||||||
Loading…
x
Reference in New Issue
Block a user