chore: remove statik

pull/1107/head
Ink33 4 years ago
parent 24fdeff599
commit 7d3bc3f0f1
No known key found for this signature in database
GPG Key ID: 5D8B1D036EFB0D2E

@ -9,26 +9,22 @@ jobs:
name: Build
runs-on: ubuntu-18.04
steps:
- name: Set up Golang
uses: actions/setup-go@v1
- name: Set up Go 1.17
uses: actions/setup-go@v2
with:
go-version: 1.17
go-version: "1.17"
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
with:
clean: false
submodules: 'recursive'
submodules: "recursive"
- run: |
git fetch --prune --unshallow --tags
- name: Get dependencies and build
run: |
go install github.com/rakyll/statik
export PATH=$PATH:~/go/bin/
statik -src=models -f
sudo apt-get update
sudo apt-get -y install gcc-mingw-w64-x86-64
sudo apt-get -y install gcc-arm-linux-gnueabihf libc6-dev-armhf-cross

@ -27,8 +27,9 @@ jobs:
- name: Build static files
run: |
cd assets
yarn install
yarn run build
mkdir build
cd build
touch test.html
- name: Test
run: go test -coverprofile=coverage.txt -covermode=atomic ./...

@ -4,10 +4,11 @@ go:
node_js: "12.16.3"
git:
depth: 1
install:
- go get github.com/rakyll/statik
before_script:
- statik -src=models -f
- cd assets
- mkdir build
- cd mkdir
- touch test.html
script:
- go test -coverprofile=coverage.txt -covermode=atomic ./...
after_success:

@ -28,8 +28,6 @@ RUN set -ex \
&& apk add gcc libc-dev git \
&& export COMMIT_SHA=$(git rev-parse --short HEAD) \
&& export VERSION=$(git describe --tags) \
&& (cd && go get github.com/rakyll/statik) \
&& statik -src=assets/build/ -include=*.html,*.js,*.json,*.css,*.png,*.svg,*.ico -f \
&& go install -ldflags "-X 'github.com/cloudreve/Cloudreve/v3/pkg/conf.BackendVersion=${VERSION}' \
-X 'github.com/cloudreve/Cloudreve/v3/pkg/conf.LastCommit=${COMMIT_SHA}'\
-w -s"

@ -68,7 +68,7 @@ chmod +x ./cloudreve
## :gear: 构建
自行构建前需要拥有 `Go >= 1.16`、`yarn`等必要依赖。
自行构建前需要拥有 `Go >= 1.17`、`yarn`等必要依赖。
#### 克隆代码

@ -1,6 +1,9 @@
#!/bin/bash
REPO=$(cd $(dirname $0); pwd)
REPO=$(
cd $(dirname $0)
pwd
)
COMMIT_SHA=$(git rev-parse --short HEAD)
VERSION=$(git describe --tags)
ASSETS="false"
@ -19,22 +22,16 @@ debugInfo () {
buildAssets() {
cd $REPO
rm -rf assets/build
rm -f statik/statik.go
export CI=false
cd $REPO/assets
yarn --update-checksums
yarn install
yarn run build
if ! [ -x "$(command -v statik)" ]; then
export CGO_ENABLED=0
go get github.com/rakyll/statik
fi
cd $REPO
statik -src=assets/build/ -include=*.html,*.js,*.json,*.css,*.png,*.svg,*.ico,*.ttf -f
cd build
rm -rf *.map
}
buildBinary() {
@ -86,8 +83,8 @@ release(){
}
usage() {
echo "Usage: $0 [-a] [-c] [-b] [-r]" 1>&2;
exit 1;
echo "Usage: $0 [-a] [-c] [-b] [-r]" 1>&2
exit 1
}
while getopts "bacr:d" o; do

Loading…
Cancel
Save