Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# 开发资料不进 Docker 构建上下文。
# Dockerfile 采用白名单 COPY,这里再加一层保险。
skills/
docs/
front/
assets/
.github/
.git/
logs/
*.md
59 changes: 14 additions & 45 deletions .github/workflows/FNOS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,11 @@ on:
paths:
- fn_version

jobs:
build-frontend:
runs-on: ubuntu-latest
steps:
- name: Checkout frontend code
uses: actions/checkout@v3
with:
repository: dongshull/Docker-Copilot-React
path: './frontend'
ref: 'master'

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '22'
cache: 'npm'
cache-dependency-path: |
frontend/package-lock.json
frontend/package.json

- name: Build Frontend
run: |
cd frontend
npm ci
npm run build

- name: Upload Frontend Artifacts
uses: actions/upload-artifact@v4
with:
name: my-artifact-front-dist
path: frontend/dist
permissions:
contents: write

jobs:
build-backend:
needs: [ build-frontend ]
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -50,15 +21,6 @@ jobs:
- name: Checkout code back end
uses: actions/checkout@v3

- name: Download Frontend Artifacts
uses: actions/download-artifact@v4
with:
pattern: my-artifact-front-*
merge-multiple: true
path: front

- run: ls -R front

- name: Get version from file
id: get_version
run: |
Expand All @@ -75,7 +37,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.23.4'
go-version: '1.24.1'
cache: false

- name: Build for ${{ matrix.arch }}
Expand All @@ -84,7 +46,10 @@ jobs:

- name: Compress binary
run: |
tar -czvf dockerCopilot-${{ matrix.arch }}.tar.gz dist/linux/${{ matrix.arch }}/dockerCopilot-new
tar -czvf dockerCopilot-${{ matrix.arch }}.tar.gz -C dist/linux/${{ matrix.arch }} dockerCopilot-new

- name: Generate checksum
run: sha256sum dockerCopilot-${{ matrix.arch }}.tar.gz > dockerCopilot-${{ matrix.arch }}.tar.gz.sha256

- name: List current directory
run: ls -la
Expand All @@ -108,12 +73,16 @@ jobs:
run: |
gh release create ${{ env.version }} \
--title "${{ env.version }}" \
--notes "Release of version ${{ env.version }}"
--notes "Release of version ${{ env.version }}" \
|| gh release view ${{ env.version }} >/dev/null
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload Asset for ${{ matrix.arch }}
run: |
gh release upload ${{ env.version }} dockerCopilot-${{ matrix.arch }}.tar.gz
gh release upload ${{ env.version }} \
dockerCopilot-${{ matrix.arch }}.tar.gz \
dockerCopilot-${{ matrix.arch }}.tar.gz.sha256 \
--clobber
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59 changes: 14 additions & 45 deletions .github/workflows/UGREEN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,11 @@ on:
paths:
- ugreen_version

jobs:
build-frontend:
runs-on: ubuntu-latest
steps:
- name: Checkout frontend code
uses: actions/checkout@v3
with:
repository: dongshull/Docker-Copilot-React
path: './frontend'
ref: 'master'

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '22'
cache: 'npm'
cache-dependency-path: |
frontend/package-lock.json
frontend/package.json

- name: Build Frontend
run: |
cd frontend
npm ci
npm run build

- name: Upload Frontend Artifacts
uses: actions/upload-artifact@v4
with:
name: my-artifact-front-dist
path: frontend/dist
permissions:
contents: write

jobs:
build-backend:
needs: [ build-frontend ]
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -50,15 +21,6 @@ jobs:
- name: Checkout code back end
uses: actions/checkout@v3

- name: Download Frontend Artifacts
uses: actions/download-artifact@v4
with:
pattern: my-artifact-front-*
merge-multiple: true
path: front

- run: ls -R front

- name: Get version from file
id: get_version
run: |
Expand All @@ -75,7 +37,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.23.4'
go-version: '1.24.1'
cache: false

- name: Build for ${{ matrix.arch }}
Expand All @@ -84,7 +46,10 @@ jobs:

- name: Compress binary
run: |
tar -czvf dockerCopilot-${{ matrix.arch }}.tar.gz dist/linux/${{ matrix.arch }}/dockerCopilot-new
tar -czvf dockerCopilot-${{ matrix.arch }}.tar.gz -C dist/linux/${{ matrix.arch }} dockerCopilot-new

- name: Generate checksum
run: sha256sum dockerCopilot-${{ matrix.arch }}.tar.gz > dockerCopilot-${{ matrix.arch }}.tar.gz.sha256

- name: List current directory
run: ls -la
Expand All @@ -108,12 +73,16 @@ jobs:
run: |
gh release create ${{ env.version }} \
--title "${{ env.version }}" \
--notes "Release of version ${{ env.version }}"
--notes "Release of version ${{ env.version }}" \
|| gh release view ${{ env.version }} >/dev/null
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload Asset for ${{ matrix.arch }}
run: |
gh release upload ${{ env.version }} dockerCopilot-${{ matrix.arch }}.tar.gz
gh release upload ${{ env.version }} \
dockerCopilot-${{ matrix.arch }}.tar.gz \
dockerCopilot-${{ matrix.arch }}.tar.gz.sha256 \
--clobber
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: CI

on:
push:
branches:
- latest
- dev
pull_request:
branches:
- latest
- dev

jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true

- name: Build
run: go build ./...

- name: Vet
run: go vet ./...

- name: Test
run: go test ./... -count=1
45 changes: 2 additions & 43 deletions .github/workflows/docker-build-push-UGREEN-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,39 +9,7 @@ on:
- ugreen_version

jobs:
build-frontend:
runs-on: ubuntu-latest
steps:
- name: Checkout frontend code
uses: actions/checkout@v3
with:
repository: dongshull/Docker-Copilot-React
path: './frontend'
ref: 'master'

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '22'
cache: 'npm'
cache-dependency-path: |
frontend/package-lock.json
frontend/package.json

- name: Build Frontend
run: |
cd frontend
npm ci
npm run build

- name: Upload Frontend Artifacts
uses: actions/upload-artifact@v4
with:
name: my-artifact-front-dist
path: frontend/dist

build-backend:
needs: [ build-frontend ]
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -50,15 +18,6 @@ jobs:
- name: Checkout code back end
uses: actions/checkout@v3

- name: Download Frontend Artifacts
uses: actions/download-artifact@v4
with:
pattern: my-artifact-front-*
merge-multiple: true
path: front

- run: ls -R front

- name: Get version from file
id: get_version
run: |
Expand All @@ -75,7 +34,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.23.4'
go-version: '1.24.1'
cache: false

- name: Build for ${{ matrix.arch }}
Expand All @@ -96,7 +55,7 @@ jobs:

docker-setup:
runs-on: ubuntu-latest
needs: [ build-frontend, build-backend ]
needs: build-backend
steps:
- name: Checkout code Now Code
uses: actions/checkout@v3
Expand Down
45 changes: 2 additions & 43 deletions .github/workflows/docker-build-push-UGREEN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,7 @@ on:
- latest-dev

jobs:
build-frontend:
runs-on: ubuntu-latest
steps:
- name: Checkout frontend code
uses: actions/checkout@v3
with:
repository: dongshull/Docker-Copilot-React
path: './frontend'
ref: 'master'

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '22'
cache: 'npm'
cache-dependency-path: |
frontend/package-lock.json
frontend/package.json

- name: Build Frontend
run: |
cd frontend
npm ci
npm run build

- name: Upload Frontend Artifacts
uses: actions/upload-artifact@v4
with:
name: my-artifact-front-dist
path: frontend/dist

build-backend:
needs: [ build-frontend ]
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -48,15 +16,6 @@ jobs:
- name: Checkout code back end
uses: actions/checkout@v3

- name: Download Frontend Artifacts
uses: actions/download-artifact@v4
with:
pattern: my-artifact-front-*
merge-multiple: true
path: front

- run: ls -R front

- name: Get version from file
id: get_version
run: |
Expand All @@ -73,7 +32,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.23.4'
go-version: '1.24.1'
cache: false

- name: Build for ${{ matrix.arch }}
Expand All @@ -94,7 +53,7 @@ jobs:

docker-setup:
runs-on: ubuntu-latest
needs: [ build-frontend, build-backend ]
needs: build-backend
steps:
- name: Checkout code Now Code
uses: actions/checkout@v3
Expand Down
Loading