diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 7d58c6b..9b8afd5 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=dontcrack-android-linux-kernel-docker-image-${GITHUB_REF_NAME//\//-}" >> "$GITHUB_ENV" - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v7 with: name: ${{ env.ARTIFACT_NAME }} path: 'dontcrack-android-linux-kernel-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: 'dontcrack-android-linux-kernel-image.tar.gz' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 31c7ab7..c9eb64f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,8 +23,8 @@ jobs: - { target: android-arm64, goos: linux, goarch: arm64, ext: '' } - { target: android-armv7, goos: linux, goarch: arm, ext: '' } steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 + - uses: actions/checkout@v7 + - uses: actions/setup-go@v7 with: go-version: '1.26' - name: '编译 ${{ matrix.target }}' @@ -40,7 +40,7 @@ jobs: else tar czf ../dontcrack-android-linux-kernel-${{ matrix.target }}.tar.gz dontcrack-android-linux-kernel fi - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v7 with: name: 'dontcrack-android-linux-kernel-${{ matrix.target }}' path: '${{ github.workspace }}/dontcrack-android-linux-kernel-${{ matrix.target }}.*' @@ -52,7 +52,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 @@ -74,7 +74,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 a170876..59a1826 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,13 @@ # syntax=docker/dockerfile:1.7 # 多阶段构建:golang 编译 → alpine 精简运行镜像(约 10MB) -FROM golang:1.25-alpine AS build +FROM golang:1.27-alpine AS build # 通过 goproxy.cn 拉取依赖, 避免在无外网代理环境(如国内网络/受限内网)构建超时 ENV GOPROXY=https://goproxy.cn,direct WORKDIR /src COPY . . RUN CGO_ENABLED=0 go build -ldflags="-s -w" -o /out/app . -FROM alpine:3.20 +FROM alpine:3.24 RUN addgroup -S app && adduser -S -G app app COPY --from=build /out/app /usr/local/bin/app USER app