mirror of
https://github.com/anyproto/anytype-ts.git
synced 2025-06-08 05:57:02 +09:00
fix workflow
This commit is contained in:
parent
6949196e4f
commit
30aee20215
2 changed files with 86 additions and 3 deletions
6
.github/workflows/build.yml
vendored
6
.github/workflows/build.yml
vendored
|
@ -44,14 +44,14 @@ jobs:
|
|||
- name: Update Addon Windows
|
||||
if: matrix.os == 'windows-latest'
|
||||
shell: bash
|
||||
run: ./update.sh ${{matrix.os}}
|
||||
run: ./update-ci.sh ${{secrets.USER}} ${{secrets.TOKEN}} ${{matrix.os}}
|
||||
|
||||
- name: Update Addon
|
||||
if: matrix.os != 'windows-latest'
|
||||
shell: bash
|
||||
run: |
|
||||
./update.sh ${{matrix.os}} arm
|
||||
./update.sh ${{matrix.os}} amd
|
||||
./update-ci.sh ${{secrets.USER}} ${{secrets.TOKEN}} ${{matrix.os}} arm
|
||||
./update-ci.sh ${{secrets.USER}} ${{secrets.TOKEN}} ${{matrix.os}} amd
|
||||
|
||||
- name: Build Front Mac OS
|
||||
if: matrix.os == 'macos-latest'
|
||||
|
|
83
update-ci.sh
Executable file
83
update-ci.sh
Executable file
|
@ -0,0 +1,83 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
REPO="anyproto/anytype-heart"
|
||||
FILE="addon.tar.gz"
|
||||
GITHUB="api.github.com"
|
||||
|
||||
user=$1
|
||||
token=$2;
|
||||
platform=${3:-ubuntu-latest};
|
||||
arch=$4;
|
||||
folder="build";
|
||||
|
||||
if [ "$platform" = "ubuntu-latest" ]; then
|
||||
arch="linux-$arch";
|
||||
folder="$arch";
|
||||
elif [ "$platform" = "macos-latest" ]; then
|
||||
arch="darwin-$arch";
|
||||
folder="$arch";
|
||||
elif [ "$platform" = "windows-latest" ]; then
|
||||
arch="windows";
|
||||
folder="dist";
|
||||
FILE="addon.zip"
|
||||
fi;
|
||||
|
||||
echo "Arch: $arch"
|
||||
echo "Folder: $folder"
|
||||
echo ""
|
||||
|
||||
if [ "$arch" = "" ]; then
|
||||
echo "ERROR: arch not found"
|
||||
exit 1
|
||||
fi;
|
||||
|
||||
mwv=`cat middleware.version`
|
||||
|
||||
version=`curl -u "$user:$token" -H "Accept: application/vnd.github.v3+json" -sL https://$GITHUB/repos/$REPO/releases/tags/v$mwv | jq .`
|
||||
|
||||
tag=`echo $version | jq ".tag_name"`
|
||||
asset_id=`echo $version | jq ".assets | map(select(.name | match(\"js_v[0-9]+.[0-9]+.[0-9]+(-rc[0-9]+)?_$arch\";\"i\")))[0].id"`
|
||||
|
||||
if [ "$asset_id" = "" ]; then
|
||||
echo "ERROR: version not found"
|
||||
exit 1
|
||||
fi;
|
||||
|
||||
printf "Version: $tag\n"
|
||||
printf "Found asset: $asset_id\n"
|
||||
echo -n "Downloading file..."
|
||||
curl -sL -H "Authorization: token $token" -H 'Accept: application/octet-stream' "https://$GITHUB/repos/$REPO/releases/assets/$asset_id" > $FILE
|
||||
printf "Done\n"
|
||||
|
||||
if [ "$platform" = "windows-latest" ]; then
|
||||
echo -n "Uncompressing... "
|
||||
unzip $FILE
|
||||
printf "Done\n"
|
||||
|
||||
echo "Moving... "
|
||||
mv -fv grpc-server.exe "$folder/anytypeHelper.exe"
|
||||
else
|
||||
echo -n "Uncompressing... "
|
||||
tar -zxf $FILE
|
||||
printf "Done\n"
|
||||
|
||||
echo "Moving... "
|
||||
rm -rf "$folder"
|
||||
mkdir -p "$folder"
|
||||
mv -fv grpc-server "$folder/anytypeHelper"
|
||||
fi;
|
||||
|
||||
rm -rf dist/lib/pb
|
||||
rm -rf dist/lib/pkg
|
||||
rm -rf dist/lib/protos
|
||||
rm -rf dist/lib/json/generated/*.json
|
||||
|
||||
mv -fv protobuf/* "dist/lib/"
|
||||
mkdir -p dist/lib/json/generated
|
||||
mv -fv json/* "dist/lib/json/generated"
|
||||
rm -rf protobuf
|
||||
rm -rf relations
|
||||
rm -rf json
|
||||
rm -rf $FILE
|
||||
|
||||
printf "Done\n\n"
|
Loading…
Add table
Add a link
Reference in a new issue