Update docker-image.yml

This commit is contained in:
losehu 2023-12-08 22:38:24 +08:00 committed by GitHub
parent 166d9b8072
commit d55849b496
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,52 +1,48 @@
on: # 指定触发 workflow 的事件 User
push: # 当代码推送时触发 on:
push:
jobs: # 定义工作流程 jobs:
build: # 工作流名称为 build build:
runs-on: ubuntu-22.04
container:
image: archlinux:latest
steps:
- name: Install dependencies
run: |
pacman -Syyu --noconfirm \
base-devel \
arm-none-eabi-gcc \
arm-none-eabi-newlib \
git \
python-pip \
python-crcmod
runs-on: ubuntu-22.04 # 使用 Ubuntu 22.04 环境执行 - name: Checkout
uses: actions/checkout@v3
container: # 定义容器 - name: safe.directory
image: archlinux:latest # 使用 Arch Linux 镜像
steps: # 定义工作流程中的步骤
- name: Install dependencies
run: |
pacman -Syyu --noconfirm \
base-devel \
arm-none-eabi-gcc \
arm-none-eabi-newlib \
git \
python-pip \
python-crcmod
- name: Checkout # 拉取代码
uses: actions/checkout@v3 # 使用 GitHub Actions 提供的 checkout 动作
- name: safe.directory # 设置 git 的 safe.directory 配置
run: git config --global --add safe.directory /__w/uv-k5-firmware-custom/uv-k5-firmware-custom run: git config --global --add safe.directory /__w/uv-k5-firmware-custom/uv-k5-firmware-custom
- name: Make # 执行 make 命令 - name: Make
run: make # 编译项目 run: make
- name: size # 计算 firmware 大小 - name: size
run: arm-none-eabi-size firmware # 使用 arm-none-eabi-size 命令计算固件大小 run: arm-none-eabi-size firmware
- name: Upload Artifact # 上传固件文件 - name: Upload Artifact
uses: actions/upload-artifact@v3 # 使用 GitHub Actions 提供的 upload-artifact 动作 uses: actions/upload-artifact@v3
with: with:
name: firmware # 设置 artifact 名称为 firmware name: firmware
path: firmware*.bin # 上传文件路径为 firmware*.bin path: firmware*.bin
- name: Upload binaries to release # 将二进制文件上传到 release - name: Upload binaries to release
if: ${{ startsWith(github.ref, 'refs/tags/v') }} # 设置条件,当 ref 以 'refs/tags/v' 开头时执行 if: ${{ startsWith(github.ref, 'refs/tags/v') }}
uses: svenstaro/upload-release-action@v2 # 使用 GitHub Actions 提供的 upload-release-action 动作 uses: svenstaro/upload-release-action@v2
with: with:
repo_token: ${{ secrets.GITHUB_TOKEN }} # GitHub token repo_token: ${{ secrets.GITHUB_TOKEN }}
file: firmware.packed.bin # 要上传的文件 file: firmware.packed.bin
asset_name: LoseHu_$tag.bin # 上传的文件名 asset_name: egzumer_$tag.packed.bin
tag: ${{ github.ref }} # GitHub ref tag: ${{ github.ref }}
overwrite: true # 覆盖已有的文件 overwrite: true
release_name: release ${{ github.ref_name }} # 发布名称为 release + ref 名称 release_name: release ${{ github.ref_name }}