From 67c55d8b66b54802efcbfe56445091791cee60f3 Mon Sep 17 00:00:00 2001 From: wukongdaily <143675923+wukongdaily@users.noreply.github.com> Date: Tue, 10 Dec 2024 11:52:11 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=80=E5=8C=96=E5=B7=A5=E4=BD=9C=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/amd64-release.yml | 2 +- .github/workflows/amd64.yml | 30 +++++++++++++---------------- .github/workflows/arm32.yml | 28 ++++++++++++--------------- .github/workflows/arm64.yml | 27 ++++++++++++-------------- 4 files changed, 38 insertions(+), 49 deletions(-) diff --git a/.github/workflows/amd64-release.yml b/.github/workflows/amd64-release.yml index b0a21a26..8dc5ea37 100644 --- a/.github/workflows/amd64-release.yml +++ b/.github/workflows/amd64-release.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: docker_images: - description: '请填写docker镜像名称,多个用英文逗号分开' + description: '请填写docker镜像名称,多个用英文逗号分开' required: true default: 'alpine:latest,alpine/curl,busybox:stable-glibc' diff --git a/.github/workflows/amd64.yml b/.github/workflows/amd64.yml index 869b7a3e..ec8b0f2a 100644 --- a/.github/workflows/amd64.yml +++ b/.github/workflows/amd64.yml @@ -5,11 +5,11 @@ on: docker_images: description: '请填写docker镜像名称 多个用英文逗号分开' required: true - default: 'alpine:latest' # 设置默认的 Docker 镜像列表 + default: 'alpine:latest,busybox:stable-glibc' # 设置默认的 Docker 镜像列表 jobs: pull_and_package: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Checkout repository @@ -23,22 +23,18 @@ jobs: - name: Pull Docker Images and Package run: | images="${{ github.event.inputs.docker_images }}" - IFS=',' read -r -a image_array <<< "$images" - for image in "${image_array[@]}"; do - docker pull "${image}" --platform "linux/amd64" - docker save "${image}" -o "${image//\//_}-amd64.tar" - done - - - name: Compress the TAR files - run: tar -czf x86-64-images.tar.gz *-amd64.tar + IFS=',' read -r -a image_array <<< "$images" + for image in "${image_array[@]}"; do + docker pull "${image}" --platform "linux/amd64" + image_name="${image//\//_}" + image_name="${image_name//:/_}" + docker save "${image}" -o "${image_name}-amd64.tar" + tar -czf "${image_name}.tar.gz" "${image_name}-amd64.tar"; rm "${image_name}-amd64.tar" + done - name: Upload artifact uses: actions/upload-artifact@v4 with: - name: docker-images-tar - path: x86-64-images.tar.gz - retention-days: 1 # 将保留天数设置为 1 天 最多可设置90天 - - - name: Clean up intermediate files - run: | - rm *-amd64.tar + name: my-artifact + path: ${{ github.workspace }}/*.tar.gz + retention-days: 1 # 将保留天数设置为 1 天 最多可设置90天 \ No newline at end of file diff --git a/.github/workflows/arm32.yml b/.github/workflows/arm32.yml index 51d702e1..807548cb 100644 --- a/.github/workflows/arm32.yml +++ b/.github/workflows/arm32.yml @@ -6,11 +6,11 @@ on: docker_images: description: '请填写docker镜像名称 多个用英文逗号分开' required: true - default: 'alpine:latest,ubuntu:latest' # 设置默认的 Docker 镜像列表 + default: 'alpine:latest,busybox:stable-glibc' # 设置默认的 Docker 镜像列表 jobs: pull_and_package: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Checkout repository @@ -19,22 +19,18 @@ jobs: - name: Pull Docker Images and Package run: | images="${{ github.event.inputs.docker_images }}" - IFS=',' read -r -a image_array <<< "$images" - for image in "${image_array[@]}"; do - docker pull "${image}" --platform "linux/arm/v7" - docker save "${image}" -o "${image//\//_}-arm32.tar" - done - - - name: Compress the TAR files - run: tar -czf arm32-images.tar.gz *-arm32.tar + IFS=',' read -r -a image_array <<< "$images" + for image in "${image_array[@]}"; do + docker pull "${image}" --platform "linux/arm/v7" + image_name="${image//\//_}" + image_name="${image_name//:/_}" + docker save "${image}" -o "${image_name}-arm32.tar" + tar -czf "${image_name}.tar.gz" "${image_name}-arm32.tar"; rm "${image_name}-arm32.tar" + done - name: Upload artifact uses: actions/upload-artifact@v4 with: - name: docker-images-tar - path: arm32-images.tar.gz + name: my-artifact + path: ${{ github.workspace }}/*.tar.gz retention-days: 1 # 将保留天数设置为 1 天 最多可设置90天 - - - name: Clean up intermediate files - run: | - rm *-arm32.tar diff --git a/.github/workflows/arm64.yml b/.github/workflows/arm64.yml index 16ed755f..8a100bab 100644 --- a/.github/workflows/arm64.yml +++ b/.github/workflows/arm64.yml @@ -6,11 +6,11 @@ on: docker_images: description: '请填写docker镜像名称 多个用英文逗号分开' required: true - default: 'alpine:latest,ubuntu:latest' # 设置默认的 Docker 镜像列表 + default: 'alpine:latest,busybox:stable-glibc' # 设置默认的 Docker 镜像列表 jobs: pull_and_package: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Checkout repository @@ -19,22 +19,19 @@ jobs: - name: Pull Docker Images and Package run: | images="${{ github.event.inputs.docker_images }}" - IFS=',' read -r -a image_array <<< "$images" - for image in "${image_array[@]}"; do - docker pull "${image}" --platform "linux/arm64" - docker save "${image}" -o "${image//\//_}-arm64.tar" - done - - - name: Compress the TAR files - run: tar -czf arm64-images.tar.gz *-arm64.tar + IFS=',' read -r -a image_array <<< "$images" + for image in "${image_array[@]}"; do + docker pull "${image}" --platform "linux/arm64" + image_name="${image//\//_}" + image_name="${image_name//:/_}" + docker save "${image}" -o "${image_name}-arm64.tar" + tar -czf "${image_name}.tar.gz" "${image_name}-arm64.tar"; rm "${image_name}-arm64.tar" + done - name: Upload artifact uses: actions/upload-artifact@v4 with: - name: docker-images-tar - path: arm64-images.tar.gz + name: my-artifact + path: ${{ github.workspace }}/*.tar.gz retention-days: 1 # 将保留天数设置为 1 天 最多可设置90天 - - name: Clean up intermediate files - run: | - rm *-arm64.tar