Skip to content

更新github action #78

更新github action

更新github action #78

Workflow file for this run

name: Build ALL
on:
workflow_dispatch:
push:
jobs:
build:
name: Build all keyboard
runs-on: ubuntu-latest
steps:
# 下载源码
- name: ⏬ Get source
uses: actions/checkout@v4
with:
submodules: recursive
# 下载安装相关工具
- name: ⚙️ Install Tools
run: |
sudo apt-get update
sudo apt-get -y install python3-pip python3-setuptools
sudo pip3 install --upgrade pip
sudo pip3 install nrfutil
wget https://sourceforge.net/projects/sdcc/files/sdcc-linux-amd64/4.0.0/sdcc-4.0.0-amd64-unknown-linux2.5.tar.bz2 -O /tmp/sdcc-4.0.0-amd64-unknown-linux2.5.tar.bz2
tar xf /tmp/sdcc-4.0.0-amd64-unknown-linux2.5.tar.bz2 -C /tmp
sudo cp -r /tmp/sdcc-4.0.0/* /usr/local
wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2019q4/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2 -O /tmp/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2
tar xf /tmp/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2 -C /tmp
wget https://github.com/genokolar/nrf52_tools/raw/main/mergehex -O /tmp/mergehex
sudo cp -r /tmp/mergehex /usr/local/bin/mergehex
sudo chmod 0755 /usr/local/bin/mergehex
echo GNU_INSTALL_ROOT := /tmp/gcc-arm-none-eabi-9-2019-q4-major/bin/>template/Makefile.posix
echo GNU_VERSION := 9.2.1>>template/Makefile.posix
echo GNU_PREFIX := arm-none-eabi>>template/Makefile.posix
# 编译固件
- name: ⚒️ Make Firmware
run: |
cd keyboard
make -j4
cd ../
# 生成发布tag
- name: 🎉 Generate release tag
run: |
echo "VERSION=11`git log --abbrev-commit --pretty=oneline -1 | cut -c 1-6 || echo 'unknown'`" >> $GITHUB_ENV
echo "BUILDTIME=`date '+%Y%m%d'`" >> $GITHUB_ENV
# 上传编译生成的固件
- name: 📤 Upload Artifact Files
uses: actions/upload-artifact@v4
with:
name: LotKB_Keyboard_Firmware_${{ env.BUILDTIME }}_${{ env.VERSION }}
path: |
${{ github.workspace }}/keyboard/_build/*.zip
${{ github.workspace }}/keyboard/_build/*.hex
${{ github.workspace }}/keyboard/_build/*.bin