Skip to content

Commit

Permalink
chore: build
Browse files Browse the repository at this point in the history
  • Loading branch information
jing332 committed Jan 17, 2024
1 parent cd04d17 commit a1dc6f1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 37 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ jobs:

- name: Build
run: |
cd $GITHUB_WORKSPACE/alist-lib
GOARCH=${{ matrix.GO_ARCH }}
declare -A goarch2cc=( ["arm64"]="aarch64-linux-android32-clang" ["arm"]="armv7a-linux-androideabi32-clang" ["amd64"]="x86_64-linux-android32-clang" ["386"]="i686-linux-android32-clang")
Expand Down
15 changes: 4 additions & 11 deletions alist-lib/scripts/init_alist_core.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
TAG_NAME=$(curl -s https://api.github.com/repos/alist-org/alist/releases/latest | grep -o '"tag_name": ".*"' | cut -d'"' -f4)
GIT_REPO="https://github.com/alist-org/alist.git"

URL="https://github.com/alist-org/alist/archive/refs/tags/${TAG_NAME}.tar.gz"
echo "Downloading alist ${TAG_NAME} from ${URL}"
TAG_NAME=$(git -c 'versionsort.suffix=-' ls-remote --exit-code --refs --sort='version:refname' --tags $GIT_REPO | tail --lines=1 | cut --delimiter='/' --fields=3)

curl -L -o "alist.tgz" $URL
tar xf "alist.tgz" --strip-components 1 -C ../

#echo "Write version to local.properties"
#cd ../../
#touch local.properties
#sed -i '/ALIST_VERSION/d' local.properties
#echo "ALIST_VERSION=${TAG_NAME}" >> local.properties
echo "AList - ${TAG_NAME}"
git clone --branch "$TAG_NAME" https://github.com/alist-org/alist.git ../alist
4 changes: 2 additions & 2 deletions alist-lib/scripts/init_alist_web.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
curl -L https://github.com/alist-org/alist-web/releases/latest/download/dist.tar.gz -o dist.tar.gz
tar -zxvf dist.tar.gz
rm -rf ../public/dist
mv -f dist ../public
rm -rf ../alist/public/dist
mv -f dist ../alist/public
rm -rf dist.tar.gz
27 changes: 5 additions & 22 deletions alist-lib/scripts/install_alist.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#!/bin/bash

export dir=$PWD
function build() {
echo "Building $1 $2 ${PWD}"
echo "Building $1 $2"

export CGO_ENABLED=1
export GOOS=android
Expand All @@ -11,27 +10,11 @@ function build() {
FN="libalist.so"
rm -f ${FN}

cd ../alist || exit
go build -ldflags "-s -w" -o ${FN}

mkdir -p ${dir}/../android/app/libs/$2
cp -f ${FN} ${dir}/../android/app/libs/$2
mkdir -p ../../android/app/libs/"$2"
cp -f ${FN} ../../android/app/libs/"$2"
}

#cp -f ./frp-*/conf/* ../app/src/main/assets/defaultData

build $1 $2

# function build_all() {
# rm -f $1
# build $1 "arm" "armeabi-v7a"
# build $1 "arm64" "arm64-v8a"
# build $1 "386" "x86"
# build $1 "amd64" "x86_64"
# }

# cd frp-*/cmd
# cd ./frpc
# build_all frpc

# cd ./frps
# build_all frps
build "$1" "$2"

0 comments on commit a1dc6f1

Please sign in to comment.