mirror of
https://github.com/DullJZ/s3-balance.git
synced 2026-09-07 08:56:38 +08:00
Dockerfile & workflow
This commit is contained in:
@@ -94,10 +94,62 @@ jobs:
|
|||||||
draft: false
|
draft: false
|
||||||
prerelease: false
|
prerelease: false
|
||||||
|
|
||||||
- name: Upload All Release Assets
|
- name: Upload Linux AMD64 Release Asset
|
||||||
uses: actions/upload-release-asset@v1
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
asset_path: ./build
|
asset_path: ./build/S3Balance_linux_amd64
|
||||||
asset_name: ""
|
asset_name: S3Balance_linux_amd64
|
||||||
|
asset_content_type: application/octet-stream
|
||||||
|
|
||||||
|
- name: Upload Linux ARM64 Release Asset
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
asset_path: ./build/S3Balance_linux_arm64
|
||||||
|
asset_name: S3Balance_linux_arm64
|
||||||
|
asset_content_type: application/octet-stream
|
||||||
|
|
||||||
|
- name: Upload Darwin AMD64 Release Asset
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
asset_path: ./build/S3Balance_darwin_amd64
|
||||||
|
asset_name: S3Balance_darwin_amd64
|
||||||
|
asset_content_type: application/octet-stream
|
||||||
|
|
||||||
|
- name: Upload Darwin ARM64 Release Asset
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
asset_path: ./build/S3Balance_darwin_arm64
|
||||||
|
asset_name: S3Balance_darwin_arm64
|
||||||
|
asset_content_type: application/octet-stream
|
||||||
|
|
||||||
|
- name: Upload Windows AMD64 Release Asset
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
asset_path: ./build/S3Balance_windows_amd64.exe
|
||||||
|
asset_name: S3Balance_windows_amd64.exe
|
||||||
|
asset_content_type: application/octet-stream
|
||||||
|
|
||||||
|
- name: Upload Windows ARM64 Release Asset
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
asset_path: ./build/S3Balance_windows_arm64.exe
|
||||||
|
asset_name: S3Balance_windows_arm64.exe
|
||||||
asset_content_type: application/octet-stream
|
asset_content_type: application/octet-stream
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# 多阶段构建用于减小镜像大小
|
# 多阶段构建用于减小镜像大小
|
||||||
FROM golang:1.24.5-alpine AS builder
|
FROM --platform=$BUILDPLATFORM golang:1.24.5-alpine AS builder
|
||||||
|
|
||||||
# 安装构建依赖
|
# 安装构建依赖
|
||||||
# 注意:不再需要 gcc, musl-dev, sqlite-dev,因为使用 modernc.org/sqlite 纯Go驱动
|
# 注意:不再需要 gcc, musl-dev, sqlite-dev,因为使用 modernc.org/sqlite 纯Go驱动
|
||||||
@@ -16,8 +16,8 @@ RUN go mod download && go mod tidy
|
|||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# 添加构建参数以支持多架构
|
# 添加构建参数以支持多架构
|
||||||
ARG TARGETOS=linux
|
ARG TARGETOS
|
||||||
ARG TARGETARCH=amd64
|
ARG TARGETARCH
|
||||||
|
|
||||||
# 构建应用
|
# 构建应用
|
||||||
# CGO_ENABLED=0: 禁用CGO,使用纯Go SQLite驱动 (modernc.org/sqlite)
|
# CGO_ENABLED=0: 禁用CGO,使用纯Go SQLite驱动 (modernc.org/sqlite)
|
||||||
|
|||||||
Reference in New Issue
Block a user