Compare commits
No commits in common. "7671127311ff9fb7879c2119ecfdbf94482e1a59" and "8bc4b1d109d2f0075306fce1b87f1fe30a43f89e" have entirely different histories.
7671127311
...
8bc4b1d109
35
.drone.yml
35
.drone.yml
@ -4,27 +4,34 @@ type: docker
|
|||||||
name: default
|
name: default
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: build-wasm
|
|
||||||
image: emscripten/emsdk:3.0.0
|
|
||||||
commands:
|
|
||||||
- ./scripts/build-wasm.sh
|
|
||||||
|
|
||||||
- name: build
|
- name: build
|
||||||
image: node:16.18-bullseye
|
image: node:16.18-bullseye
|
||||||
commands:
|
commands:
|
||||||
- apt-get update
|
- apt-get update
|
||||||
- apt-get install -y jq zip
|
- apt-get install -y cmake jq zip
|
||||||
|
- ./scripts/build-wasm.sh
|
||||||
- npm ci
|
- npm ci
|
||||||
- npm run test
|
- npm run test
|
||||||
- ./scripts/build-and-package.sh legacy
|
- ./scripts/build-and-package.sh legacy
|
||||||
- ./scripts/build-and-package.sh extension
|
- ./scripts/build-and-package.sh extension
|
||||||
- ./scripts/build-and-package.sh modern
|
- ./scripts/build-and-package.sh modern
|
||||||
|
- sha256sum *.zip > sha256sum.txt
|
||||||
|
- mkdir -p upload
|
||||||
|
- mv *.zip sha256sum.txt upload/
|
||||||
|
|
||||||
- name: upload artifact
|
- name: upload
|
||||||
image: node:16.18-bullseye
|
image: "plugins/s3"
|
||||||
environment:
|
settings:
|
||||||
DRONE_GITEA_SERVER: https://git.unlock-music.dev
|
path_style: true
|
||||||
GITEA_API_KEY:
|
endpoint:
|
||||||
from_secret: GITEA_API_KEY
|
from_secret: S3_ENDPOINT
|
||||||
commands:
|
access_key:
|
||||||
- ./scripts/upload-packages.sh
|
from_secret: S3_ACCESS_KEY
|
||||||
|
secret_key:
|
||||||
|
from_secret: S3_SECRET_KEY
|
||||||
|
bucket:
|
||||||
|
from_secret: S3_BUCKET
|
||||||
|
region: "auto"
|
||||||
|
source: "upload/*"
|
||||||
|
strip_prefix: "upload/"
|
||||||
|
target: "${DRONE_REPO}/${DRONE_BUILD_NUMBER}/"
|
||||||
|
@ -1,19 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
set -ex
|
|
||||||
|
|
||||||
cd "$(git rev-parse --show-toplevel)"
|
|
||||||
|
|
||||||
if [ -z "$GITEA_API_KEY" ]; then
|
|
||||||
echo "GITEA_API_KEY is empty, skip upload."
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
URL_BASE="$DRONE_GITEA_SERVER/api/packages/${DRONE_REPO_NAMESPACE}/generic/${DRONE_REPO_NAME}-build"
|
|
||||||
|
|
||||||
for ZIP_NAME in *.zip; do
|
|
||||||
UPLOAD_URL="${URL_BASE}/${DRONE_BUILD_NUMBER}/${ZIP_NAME}"
|
|
||||||
sha256sum "${ZIP_NAME}"
|
|
||||||
curl -sLifu "um-release-bot:$GITEA_API_KEY" -T "${ZIP_NAME}" "${UPLOAD_URL}"
|
|
||||||
echo "Uploaded to: ${UPLOAD_URL}"
|
|
||||||
done
|
|
@ -11,20 +11,18 @@ if [ -z "$BUILD_TYPE" ]; then
|
|||||||
BUILD_TYPE=Release
|
BUILD_TYPE=Release
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# CI: already had emsdk installed.
|
mkdir -p build/wasm
|
||||||
if ! command -v emcc; then
|
|
||||||
if [ ! -d ../../build/emsdk ]; then
|
if [ ! -d ../../build/emsdk ]; then
|
||||||
git clone https://github.com/emscripten-core/emsdk.git ../../build/emsdk
|
git clone https://github.com/emscripten-core/emsdk.git ../../build/emsdk
|
||||||
fi
|
fi
|
||||||
|
|
||||||
pushd ../../build/emsdk
|
pushd ../../build/emsdk
|
||||||
|
#git pull
|
||||||
./emsdk install 3.0.0
|
./emsdk install 3.0.0
|
||||||
./emsdk activate 3.0.0
|
./emsdk activate 3.0.0
|
||||||
source ./emsdk_env.sh
|
source ./emsdk_env.sh
|
||||||
popd # ../../build/emsdk
|
popd # ../../build/emsdk
|
||||||
fi
|
|
||||||
|
|
||||||
mkdir -p build/wasm
|
|
||||||
pushd build/wasm
|
pushd build/wasm
|
||||||
emcmake cmake -DCMAKE_BUILD_TYPE="$BUILD_TYPE" ../..
|
emcmake cmake -DCMAKE_BUILD_TYPE="$BUILD_TYPE" ../..
|
||||||
make -j
|
make -j
|
||||||
|
@ -11,8 +11,7 @@ if [ -z "$BUILD_TYPE" ]; then
|
|||||||
BUILD_TYPE=Release
|
BUILD_TYPE=Release
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# CI: already had emsdk installed.
|
mkdir -p build/wasm
|
||||||
if ! command -v emcc; then
|
|
||||||
if [ ! -d ../../build/emsdk ]; then
|
if [ ! -d ../../build/emsdk ]; then
|
||||||
git clone https://github.com/emscripten-core/emsdk.git ../../build/emsdk
|
git clone https://github.com/emscripten-core/emsdk.git ../../build/emsdk
|
||||||
fi
|
fi
|
||||||
@ -22,9 +21,7 @@ if ! command -v emcc; then
|
|||||||
./emsdk activate 3.0.0
|
./emsdk activate 3.0.0
|
||||||
source ./emsdk_env.sh
|
source ./emsdk_env.sh
|
||||||
popd # ../../build/emsdk
|
popd # ../../build/emsdk
|
||||||
fi
|
|
||||||
|
|
||||||
mkdir -p build/wasm
|
|
||||||
pushd build/wasm
|
pushd build/wasm
|
||||||
emcmake cmake -DCMAKE_BUILD_TYPE="$BUILD_TYPE" ../..
|
emcmake cmake -DCMAKE_BUILD_TYPE="$BUILD_TYPE" ../..
|
||||||
make -j
|
make -j
|
||||||
|
Loading…
Reference in New Issue
Block a user