Build Factory and OTA Images #18
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 Factory and OTA Images" | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
name: "build" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v3 | |
- name: Install Dependencies | |
run: | | |
sudo apt update | |
sudo apt -y install curl wget | |
sudo apt -y install build-essential libtool gcc-arm-none-eabi binutils-arm-none-eabi libnewlib-arm-none-eabi | |
sudo apt -y install python3 python3-pip python-is-python3 | |
sudo python -m pip install -U pip | |
sudo pip install wheel click | |
- name: Populate vars | |
id: vars | |
run: | | |
echo "build_date=$(date +"%Y%m%d")" >> $GITHUB_OUTPUT | |
echo "short_hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
echo "fw_revision=$(sed -n 's/^#define FW_REVISION\s*"\(.*\)"/\1/p' app/firmware_config.h)" >> $GITHUB_OUTPUT | |
echo "artifacts_url="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"" >> $GITHUB_OUTPUT | |
- name: Build binaries | |
run: | | |
./make_binaries.sh | |
- name: Build signed images | |
env: | |
BT_SIG_PK: ${{ secrets.BT_SIG_PK }} | |
run: | | |
./make_images.sh | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: "${{ github.event.repository.name }}-${{ steps.vars.outputs.fw_revision }}-${{ steps.vars.outputs.build_date }}-${{ steps.vars.outputs.short_hash }}" | |
path: | | |
artifacts/* | |
artifacts_signed/* | |
- name: Notify to Slack | |
uses: onekeyhq/actions/notice-slack-app-update@main | |
with: | |
web-hook-url: ${{ secrets.SLACK_DEV_RELEASE_WEBHOOK }} | |
artifact-type: CLASSIC-FIRMWARE-BT | |
artifact-name: Classic-Hardware-Firmware-BT | |
artifact-bundle-id: "so.onekey.firmware.classic.bt" | |
artifact-version-name: "${{ steps.vars.outputs.fw_revision }}" | |
artifact-version-code: "${{ steps.vars.outputs.short_hash }}" | |
artifact-download-url: "${{ steps.vars.outputs.artifacts_url }}" | |
change-log: "Download [Artifacts] at the bottom of page." | |
custom-issue-url: "" | |
custom-message-title: "" | |
custom-message-payload: "" | |
filter-code: false |