Merge pull request #22 from HyperInspire/feature/ci #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Release SDKs | |
on: | |
push: | |
tags: | |
- "v*" # 当推送符合 "v*" 模式的标签时触发 | |
jobs: | |
build: | |
name: Compile and Package SDKs | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
# Step 2: Update Git submodules recursively | |
- name: Update submodules | |
run: | | |
git submodule sync --recursive # Ensure submodule paths are up-to-date | |
git submodule update --init --recursive # Initialize and update all submodules | |
# 使用 Docker Compose 构建项目 | |
- name: Build SDKs with Docker Compose | |
run: docker-compose up | |
# 压缩每个 SDK 目录 | |
- name: Zip SDK Files | |
run: | | |
zip -r linux_armv7_armhf.zip build/linux_armv7_armhf/ | |
zip -r linux_rv1109rv1126_armhf.zip build/linux_rv1109rv1126_armhf/ | |
zip -r linux_ubuntu18.zip build/linux_ubuntu18/ | |
# 上传打包文件以供发布任务使用 | |
- name: Upload SDK Artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: sdk_files | |
path: | | |
linux_armv7_armhf.zip | |
linux_rv1109rv1126_armhf.zip | |
linux_ubuntu18.zip | |
release: | |
name: Release SDKs to GitHub | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
# 下载上一个步骤上传的 SDK 文件 | |
- name: Download SDK Artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
name: sdk_files | |
# 创建 GitHub Release 并上传 SDK 文件 | |
- name: Create GitHub Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
linux_armv7_armhf.zip | |
linux_rv1109rv1126_armhf.zip | |
linux_ubuntu18.zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |