fix: 修复Gitea Actions兼容性,添加二进制和Docker镜像构建workflow

This commit is contained in:
2026-04-18 16:54:49 +08:00
parent 0fc5e9a222
commit 18f8a52be8
2 changed files with 62 additions and 9 deletions
+17 -9
View File
@@ -16,10 +16,12 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Docker Setup Buildx
uses: docker/setup-buildx-action@v3
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: node Setup
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
@@ -32,17 +34,23 @@ jobs:
yarn build
cp -r build ../server/resource/
- name: Build Docker image
- name: Build binary
run: |
docker build -t next-terminal:${{ github.event.inputs.tag }} .
cd server
go mod tidy
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags '-s -w' -o next-terminal ../main.go
- name: Export Docker image
- name: Create package
run: |
docker save next-terminal:${{ github.event.inputs.tag }} | gzip > next-terminal-${{ github.event.inputs.tag }}.tar.gz
mkdir -p next-terminal
cp server/next-terminal next-terminal/
cp config.yml.example next-terminal/config.yml
cp LICENSE next-terminal/
tar zcvf next-terminal-${{ inputs.tag }}-linux-amd64.tar.gz next-terminal/
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: next-terminal-docker-${{ github.event.inputs.tag }}
path: next-terminal-${{ github.event.inputs.tag }}.tar.gz
name: next-terminal-${{ inputs.tag }}-linux-amd64
path: next-terminal-${{ inputs.tag }}-linux-amd64.tar.gz
retention-days: 7