Skip to content

Commit

Permalink
- 仅仅保留macos release 包
Browse files Browse the repository at this point in the history
  • Loading branch information
TBXark committed Jun 12, 2022
1 parent 610f9b8 commit b79f8db
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 89 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
.idea
.bin
bin
88 changes: 3 additions & 85 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,106 +6,24 @@ VERSION=$(shell git describe --tags || echo "unknown version")
PLATFORM_LIST = \
darwin-amd64 \
darwin-arm64 \
linux-386 \
linux-amd64 \
linux-armv5 \
linux-armv6 \
linux-armv7 \
linux-armv8 \
linux-mips-softfloat \
linux-mips-hardfloat \
linux-mipsle-softfloat \
linux-mipsle-hardfloat \
linux-mips64 \
linux-mips64le \
freebsd-386 \
freebsd-amd64 \
freebsd-arm64

WINDOWS_ARCH_LIST = \
windows-386 \
windows-amd64 \
windows-arm64 \
windows-arm32v7

all: linux-amd64 darwin-amd64 windows-amd64 # Most used
all: darwin-amd64 darwin-arm64

darwin-amd64:
GOARCH=amd64 GOOS=darwin $(GOBUILD) -o $(BINDIR)/$(NAME)-$@

darwin-arm64:
GOARCH=arm64 GOOS=darwin $(GOBUILD) -o $(BINDIR)/$(NAME)-$@

linux-386:
GOARCH=386 GOOS=linux $(GOBUILD) -o $(BINDIR)/$(NAME)-$@

linux-amd64:
GOARCH=amd64 GOOS=linux $(GOBUILD) -o $(BINDIR)/$(NAME)-$@

linux-armv5:
GOARCH=arm GOOS=linux GOARM=5 $(GOBUILD) -o $(BINDIR)/$(NAME)-$@

linux-armv6:
GOARCH=arm GOOS=linux GOARM=6 $(GOBUILD) -o $(BINDIR)/$(NAME)-$@

linux-armv7:
GOARCH=arm GOOS=linux GOARM=7 $(GOBUILD) -o $(BINDIR)/$(NAME)-$@

linux-armv8:
GOARCH=arm64 GOOS=linux $(GOBUILD) -o $(BINDIR)/$(NAME)-$@

linux-mips-softfloat:
GOARCH=mips GOMIPS=softfloat GOOS=linux $(GOBUILD) -o $(BINDIR)/$(NAME)-$@

linux-mips-hardfloat:
GOARCH=mips GOMIPS=hardfloat GOOS=linux $(GOBUILD) -o $(BINDIR)/$(NAME)-$@

linux-mipsle-softfloat:
GOARCH=mipsle GOMIPS=softfloat GOOS=linux $(GOBUILD) -o $(BINDIR)/$(NAME)-$@

linux-mipsle-hardfloat:
GOARCH=mipsle GOMIPS=hardfloat GOOS=linux $(GOBUILD) -o $(BINDIR)/$(NAME)-$@

linux-mips64:
GOARCH=mips64 GOOS=linux $(GOBUILD) -o $(BINDIR)/$(NAME)-$@

linux-mips64le:
GOARCH=mips64le GOOS=linux $(GOBUILD) -o $(BINDIR)/$(NAME)-$@

freebsd-386:
GOARCH=386 GOOS=freebsd $(GOBUILD) -o $(BINDIR)/$(NAME)-$@

freebsd-amd64:
GOARCH=amd64 GOOS=freebsd $(GOBUILD) -o $(BINDIR)/$(NAME)-$@

freebsd-arm64:
GOARCH=arm64 GOOS=freebsd $(GOBUILD) -o $(BINDIR)/$(NAME)-$@

windows-386:
GOARCH=386 GOOS=windows $(GOBUILD) -o $(BINDIR)/$(NAME)-$@.exe

windows-amd64:
GOARCH=amd64 GOOS=windows $(GOBUILD) -o $(BINDIR)/$(NAME)-$@.exe

windows-arm64:
GOARCH=arm64 GOOS=windows $(GOBUILD) -o $(BINDIR)/$(NAME)-$@.exe

windows-arm32v7:
GOARCH=arm GOOS=windows GOARM=7 $(GOBUILD) -o $(BINDIR)/$(NAME)-$@.exe

gz_releases=$(addsuffix .gz, $(PLATFORM_LIST))
zip_releases=$(addsuffix .zip, $(WINDOWS_ARCH_LIST))

$(gz_releases): %.gz : %
chmod +x $(BINDIR)/$(NAME)-$(basename $@)
gzip -f -S -$(VERSION).gz $(BINDIR)/$(NAME)-$(basename $@)

$(zip_releases): %.zip : %
zip -m -j $(BINDIR)/$(NAME)-$(basename $@)-$(VERSION).zip $(BINDIR)/$(NAME)-$(basename $@).exe

all-arch: $(PLATFORM_LIST) $(WINDOWS_ARCH_LIST)
all-arch: $(PLATFORM_LIST)

releases: $(gz_releases) $(zip_releases)
releases: $(gz_releases)

lint:
golangci-lint run --disable-all -E govet -E gofumpt -E megacheck ./...
Expand Down
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ type Article struct {
Media []string
}

func (a *Article) readDetail(root string) {
file, err := os.Open(path.Join(root, fmt.Sprintf("%d.md", a.AID)))
func (a *Article) readDetail(dir string) {
file, err := os.Open(path.Join(dir, fmt.Sprintf("%d.md", a.AID)))
if err != nil {
log.Fatal(err)
}
Expand Down Expand Up @@ -149,7 +149,7 @@ func loadCategories(db *sql.DB) ([]*Category, error) {

func loadArticles(db *sql.DB) ([]*Article, error) {
row, err := db.Query("select rid, aid from cat_article;")
// row, err := db.Query("select cat_article.rid, cat_article.aid from cat_article left join article on cat_article.aid = article.uuid order by article.sort ;")
// row, err := db.Query("select cat_article.rid, cat_article.aid from cat_article left join article on cat_article.aid = article.uuid order by article.sort ;")
if err != nil {
return nil, err
}
Expand Down

0 comments on commit b79f8db

Please sign in to comment.