diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 858b288..f304dc4 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -16,9 +16,9 @@ jobs: docker-build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - name: 'Go 单元测试' - uses: actions/setup-go@v5 + uses: actions/setup-go@v7 with: go-version: '1.26' - name: '运行测试' @@ -34,7 +34,7 @@ jobs: - name: '计算工件名' shell: bash run: echo "ARTIFACT_NAME=simplewebshell-remoteupdate-docker-image-${GITHUB_REF_NAME//\//-}" >> "$GITHUB_ENV" - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v7 with: name: ${{ env.ARTIFACT_NAME }} path: 'simplewebshell-remoteupdate-image.tar.gz' @@ -42,7 +42,7 @@ jobs: retention-days: 14 - name: '上传镜像包到 Release' if: github.event_name == 'release' || startsWith(github.ref, 'refs/tags/v') - uses: softprops/action-gh-release@v2 + uses: softprops/action-gh-release@v3 with: tag_name: ${{ github.event.release.tag_name || github.ref_name }} files: 'simplewebshell-remoteupdate-image.tar.gz' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 66b93cc..28d1d22 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,10 +25,10 @@ jobs: - { target: windows-amd64, goos: windows, goarch: amd64, ext: .exe } - { target: windows-arm64, goos: windows, goarch: arm64, ext: .exe } steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 + - uses: actions/checkout@v7 + - uses: actions/setup-go@v7 with: - go-version: '1.26' + go-version: '1.25' - name: '编译 ${{ matrix.target }}' run: | mkdir -p dist @@ -42,7 +42,7 @@ jobs: else tar czf ../simplewebshell-remoteupdate-${{ matrix.target }}.tar.gz simplewebshell-remoteupdate fi - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v7 with: name: 'simplewebshell-remoteupdate-${{ matrix.target }}' path: '${{ github.workspace }}/simplewebshell-remoteupdate-${{ matrix.target }}.*' @@ -54,7 +54,7 @@ jobs: needs: build runs-on: ubuntu-latest steps: - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v8 with: path: artifacts merge-multiple: true @@ -72,7 +72,7 @@ jobs: | sort -z | xargs -0 -r sha1sum > checksums-sha1.txt - name: '上传到 Release' if: github.event_name != 'workflow_dispatch' || github.event.inputs.tag != '' - uses: softprops/action-gh-release@v2 + uses: softprops/action-gh-release@v3 with: tag_name: ${{ github.event.inputs.tag || github.event.release.tag_name || github.ref_name }} files: 'release/*' diff --git a/Dockerfile b/Dockerfile index f1acc24..7768f59 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.25-alpine AS build +FROM golang:1.27-alpine AS build # 通过 goproxy.cn 拉取依赖, 避免在无外网代理环境(如国内网络/受限内网)构建超时 ENV GOPROXY=https://goproxy.cn,direct ARG TARGETARCH=amd64 @@ -7,7 +7,7 @@ COPY go.mod ./ COPY . ./ RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} go build -trimpath -ldflags='-s -w' -o /out/simplewebshell-remoteupdate . -FROM alpine:3.21 +FROM alpine:3.24 RUN apk add --no-cache ca-certificates tar gzip unzip coreutils && \ adduser -D -H -u 1000 app && mkdir -p /app && chown -R app:app /app COPY --from=build /out/simplewebshell-remoteupdate /usr/local/bin/simplewebshell-remoteupdate