重命名并更新安装脚本 #451
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: CMake | |
on: | |
push: | |
branches: | |
- 'main' | |
paths-ignore: | |
- '**.md' | |
- '**.zip' | |
- '**.json' | |
- '.github/ISSUE_TEMPLATE/**' | |
pull_request: | |
branches: | |
- 'main' | |
env: | |
GCC_CLONE_PATH: "${{ github.workspace }}/aarch64-linux-musl-gcc" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@main | |
- name: Install tools | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y ssh git make cmake | |
- name: Clone aarch64-linux-musl-gcc | |
run: git clone https://github.com/chase535/aarch64-linux-musl-gcc.git ${GCC_CLONE_PATH} -b main --depth=1 | |
- name: Set C and C++ compiler | |
run: | | |
echo "CC=${GCC_CLONE_PATH}/bin/aarch64-linux-musl-gcc" >> ${GITHUB_ENV} | |
echo "CXX=${GCC_CLONE_PATH}/bin/aarch64-linux-musl-g++" >> ${GITHUB_ENV} | |
- name: Use CMake to generate Makefile | |
run: cmake -B build | |
- name: Build module | |
run: make -C build -j$(nproc --all) | |
- name: Copy files into module directory | |
run: | | |
cp -f ${{ github.workspace }}/README.md ${{ github.workspace }}/LICENSE ${{ github.workspace }}/module | |
cp -f ${{ github.workspace }}/build/accurate_battery ${{ github.workspace }}/module/common | |
- name : Zip and upload module | |
uses: actions/upload-artifact@main | |
with: | |
name: accurate_battery | |
path: ${{ github.workspace }}/module/* |