Unverified Commit 62320b36 authored by wukongdaily's avatar wukongdaily Committed by GitHub
Browse files

Update build-rockchip.yml

parent bee6dbad
...@@ -26,7 +26,6 @@ jobs: ...@@ -26,7 +26,6 @@ jobs:
- name: Setup Docker and Build - name: Setup Docker and Build
run: | run: |
profiles="${{ github.event.inputs.profile }}" profiles="${{ github.event.inputs.profile }}"
rootfs_partsize="${{ github.event.inputs.rootfs_partsize }}"
IFS=',' read -r -a profile_array <<< "$profiles" IFS=',' read -r -a profile_array <<< "$profiles"
...@@ -48,21 +47,19 @@ jobs: ...@@ -48,21 +47,19 @@ jobs:
run: | run: |
# 查找符合条件的固件文件 # 查找符合条件的固件文件
firmware_files=$(find "${{ github.workspace }}/bin" -type f -name '*squashfs*.img.gz') firmware_files=$(find "${{ github.workspace }}/bin" -type f -name '*squashfs*.img.gz')
# 格式化路径,以避免多余的换行或空格
firmware_files=$(echo "$firmware_files" | tr '\n' ' ')
echo "Squashfs firmware files located: $firmware_files"
echo "FIRMWARE_PATHS=$firmware_files" >> $GITHUB_ENV
# 提取文件名并设置为环境变量 # 如果有多个固件文件,按空格分割路径并保存为环境变量
firmware_name=$(basename "$firmware_files") firmware_files_array=($firmware_files)
echo "FIRMWARE_NAME=$firmware_name" >> $GITHUB_ENV
- name: Upload firmware to GitHub Artifact # 输出找到的固件文件路径
uses: actions/upload-artifact@v4 echo "Found firmware files: ${firmware_files}"
with:
name: firmware # 将所有固件文件路径合并为一个tar包
path: ${{ env.FIRMWARE_PATHS }} tar_file="firmware_files.tar.gz"
compression-level: 0 tar -czf $tar_file "${firmware_files_array[@]}"
# 将tar包路径设置为环境变量
echo "TAR_FILE=$tar_file" >> $GITHUB_ENV
- name: Set release date and tag name - name: Set release date and tag name
id: set_release_info id: set_release_info
...@@ -88,12 +85,13 @@ jobs: ...@@ -88,12 +85,13 @@ jobs:
makeLatest: true # 设置为 true makeLatest: true # 设置为 true
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
- name: Upload firmware to GitHub Release - name: Upload compressed firmware tarball to GitHub Release
uses: actions/upload-release-asset@v1 uses: actions/upload-release-asset@v1
with: with:
upload_url: ${{ steps.create_release.outputs.upload_url }} upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ env.FIRMWARE_PATHS }} # 传递固件文件路径 asset_path: ${{ env.TAR_FILE }} # 上传打包的tar.gz文件
asset_name: ${{ env.FIRMWARE_NAME }} # 使用提取的文件名 asset_name: firmware_files.tar.gz # 固件压缩包的名称
asset_content_type: application/gzip asset_content_type: application/gzip
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment