-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
upgrade: upgrade CI & add Makefile upgrade: move the authentication API to backend
- Loading branch information
Showing
1,440 changed files
with
768,074 additions
and
554 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: release-tag | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- version.txt | ||
|
||
jobs: | ||
tag: | ||
if: ${{ github.repository == 'llaoj/gcopy' }} | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- run: /usr/bin/git config --global user.email actions@github.com | ||
- run: /usr/bin/git config --global user.name 'GitHub Actions Release Tagger' | ||
- run: hack/release-tag.sh | ||
id: release_tag | ||
outputs: | ||
release_tag: ${{ steps.release_tag.outputs.release_tag }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.gcopy | ||
dist/ | ||
frontend/.env | ||
output/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
.PHONY: all \ | ||
vet fmt version test \ | ||
push-container release clean gomod | ||
|
||
# PLATFORMS is the set of OS_ARCH that NPD can build against. | ||
LINUX_PLATFORMS=linux_amd64 | ||
DOCKER_PLATFORMS=linux/amd64 | ||
PLATFORMS=$(LINUX_PLATFORMS) windows_amd64 | ||
|
||
# VERSION is the version of the binary. | ||
VERSION=$(shell cat version.txt) | ||
|
||
# TAG is the tag of the container image, default to binary version. | ||
TAG?=$(VERSION) | ||
|
||
# REGISTRY is the container registry to push into. | ||
REGISTRY?=registry.cn-beijing.aliyuncs.com/llaoj | ||
|
||
# PKG is the package name of gcopy repo. | ||
PKG:=github.com/llaoj/gcopy | ||
|
||
# GCOPY_IMAGE is the image name of the gcopy container image. | ||
GCOPY_IMAGE:=$(REGISTRY)/gcopy:$(TAG) | ||
# GCOPY_FRONTEND_IMAGE is the image name of the gcopy web client container image. | ||
GCOPY_FRONTEND_IMAGE:=$(REGISTRY)/gcopy-frontend:$(TAG) | ||
|
||
# Disable cgo by default to make the binary statically linked. | ||
CGO_ENABLED:=0 | ||
|
||
version: | ||
@echo $(VERSION) | ||
|
||
vet: | ||
go list -tags "" ./... | grep -v "./vendor/*" | xargs go vet -tags "" | ||
|
||
fmt: | ||
find . -type f -name "*.go" | grep -v "./vendor/*" | xargs gofmt -s -w -l | ||
|
||
test: vet fmt | ||
go test -timeout=1m -v -race -short ./... | ||
|
||
output/linux_amd64/bin/%: | ||
GOOS=linux GOARCH=amd64 CGO_ENABLED=$(CGO_ENABLED) \ | ||
CC=x86_64-linux-gnu-gcc go build \ | ||
-o $@ \ | ||
-ldflags '-X $(PKG)/pkg/version.version=$(VERSION)' \ | ||
./cmd | ||
touch $@ | ||
|
||
output/windows_amd64/bin/%.exe: | ||
GOOS=windows GOARCH=amd64 CGO_ENABLED=$(CGO_ENABLED) go build \ | ||
-o $@ \ | ||
-ldflags '-X $(PKG)/pkg/version.version=$(VERSION)' \ | ||
./cmd | ||
touch $@ | ||
|
||
output/darwin_amd64/bin/%: | ||
GOOS=darwin GOARCH=amd64 CGO_ENABLED=$(CGO_ENABLED) go build \ | ||
-o $@ \ | ||
-ldflags '-X $(PKG)/pkg/version.version=$(VERSION)' \ | ||
./cmd | ||
touch $@ | ||
|
||
push-container: clean | ||
docker buildx create --platform $(DOCKER_PLATFORMS) --use | ||
docker buildx build --push --platform $(DOCKER_PLATFORMS) -t $(GCOPY_IMAGE) -f build/gcopy/Dockerfile . | ||
docker buildx build --push --platform $(DOCKER_PLATFORMS) -t $(GCOPY_FRONTEND_IMAGE) -f build/frontend/Dockerfile . | ||
|
||
clean: | ||
rm -rf output/ | ||
rm -f coverage.out | ||
|
||
gomod: | ||
go mod tidy | ||
go mod vendor | ||
go mod verify |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM golang | ||
|
||
WORKDIR /app | ||
COPY . . | ||
|
||
RUN make output/linux_amd64/bin/gcopy | ||
|
||
From alpine | ||
LABEL maintainer="Llaoj <hmmmbiubiubiu@gmail.com>" | ||
|
||
WORKDIR / | ||
COPY --from=0 /app/output/linux_amd64/bin/gcopy . | ||
|
||
EXPOSE 3376 | ||
|
||
ENTRYPOINT ["/gcopy"] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
version: '3.8' | ||
services: | ||
gcopy-server: | ||
container_name: gcopy-server | ||
image: registry.cn-beijing.aliyuncs.com/llaoj/gcopy-server:v1.1.2 | ||
gcopy: | ||
container_name: gcopy | ||
image: registry.cn-beijing.aliyuncs.com/llaoj/gcopy:v1.1.5 | ||
restart: always | ||
command: ["--app-key=<app-key>", "--smtp-host=<smtp-host>", "--smtp-username=<smtp-username>", "--smtp-password=<smtp-password>", "--smtp-ssl"] | ||
|
||
gcopy-frontend: | ||
container_name: gcopy-frontend | ||
image: registry.cn-beijing.aliyuncs.com/llaoj/gcopy-frontend:v1.1.2 | ||
image: registry.cn-beijing.aliyuncs.com/llaoj/gcopy-frontend:v1.1.5 | ||
restart: always | ||
ports: | ||
- "3375:3375" | ||
volumes: | ||
- ./frontend/.env.production:/app/.env.production | ||
depends_on: | ||
- gcopy-server | ||
- gcopy | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1 @@ | ||
SERVER_URL=http://gcopy-server:3376 | ||
IRON_SESSION_PASSWORD=<at-least-32-characters-long> | ||
SMTP_HOST= | ||
SMTP_PORT=587 | ||
SMTP_USERNAME= | ||
SMTP_PASSWORD= | ||
SMTP_SENDER= | ||
SERVER_URL=http://gcopy:3376 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.