Skip to content

Commit

Permalink
feat: update ci
Browse files Browse the repository at this point in the history
  • Loading branch information
DVKunion committed Feb 29, 2024
1 parent 176b564 commit 6b8c340
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 99 deletions.
3 changes: 2 additions & 1 deletion .github/conf/.goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
before:
hooks:
- go mod tidy
-
builds:
- binary: seamoon
env:
Expand All @@ -14,7 +15,7 @@ builds:
- 6
- 7
ldflags:
- -s -w -X github.com/DVKunion/SeaMoon/pkg/consts.Version={{.Version}}
- -s -w -X github.com/DVKunion/SeaMoon/pkg/consts.Version={{.Version}} -X github.com/DVKunion/SeaMoon/pkg/consts.Commit={{.Version}}
checksum:
name_template: 'checksums.txt'
snapshot:
Expand Down
29 changes: 25 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,32 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Clone seamoon-web repository
uses: actions/checkout@v4
with:
repository: 'DVKunion/seamoon-web'
ref: 'main' # Or any other branch or tag you want to checkout
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: |
npm install
- name: Build Front
run: |
npm run build
cp -r dist /tmp
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v4
with:
go-version: 1.21
- name: Build
run: go build --ldflags "-s -w -X github.com/DVKunion/SeaMoon/pkg/consts.Version=${{github.ref_name}}" cmd/main.go

run: |
cp -r /tmp/dist cmd/client/static
go mod tidy
go build -o seamoon -v --ldflags "-s -w -X github.com/DVKunion/SeaMoon/pkg/consts.Version=${{github.ref_name}} -X github.com/DVKunion/SeaMoon/pkg/consts.Commit=${{github.sha}}" cmd/main.go
- uses: actions/upload-artifact@v4
with:
path: seamoon
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*.crt
*.key

dist/
cmd/client/static/dist/*
web/
*.log
*.toml
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ COPY .. /src
WORKDIR /src
ENV CGO_ENABLED 0
ENV VERSION=${VERSION}
RUN go build -ldflags "-X github.com/DVKunion/SeaMoon/server/consts.Version=${VERSION}" -o /tmp/seamoon cmd/main.go
ENV SHA=${SHA}
RUN go build -ldflags "-X github.com/DVKunion/SeaMoon/server/consts.Version=${VERSION} -X github.com/DVKunion/SeaMoon/server/consts.Commit=${SHA}" -o /tmp/seamoon cmd/main.go
RUN chmod +x /tmp/seamoon
# run stage
FROM alpine:3.19
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

月海之名取自于苏轼的《西江月·顷在黄州》,寓意月海取自于传统工具,用之于云,最终达到隐匿于海的效果。

月海基于 Serverless 的动态特性、分别从网络层、应用层实现对应的能力,并利用serverless-devs工具来实现快捷的部署/跨厂商操作。
月海基于 Serverless 的动态特性、分别从网络层、应用层实现对应的能力,并集成了SDK来实现快捷的部署/跨厂商操作。

想要了解更多,请移步 [官方手册](https://seamoon.dvkunion.cn)

Expand Down
91 changes: 0 additions & 91 deletions s.yaml

This file was deleted.

0 comments on commit 6b8c340

Please sign in to comment.