[no ci] Workflow: consolidate build steps

pull/850/head
Viktor 2023-06-06 05:04:21 +02:00 committed by viktorxda
parent 0400735587
commit 803fe63497
2 changed files with 8 additions and 16 deletions

View File

@ -7,9 +7,7 @@ on:
- opened
push:
branches:
- 'master'
tags:
- 'v*'
- master
workflow_dispatch:
env:

View File

@ -46,28 +46,22 @@ jobs:
with:
fetch-depth: 0
- name: Determine toolchain
- name: Build toolchain
run: |
echo "8.8.8.8 invisible-mirror.net" | sudo tee -a /etc/hosts
GCC=$(make BOARD=${{matrix.platform}}_lite toolname)
CONFIG=$(find br-ext-chip-* -name ${{matrix.platform}}_lite_defconfig)
GCC=$(make BOARD=${CONFIG} toolname)
echo GCC=${GCC} >> ${GITHUB_ENV}
URL=https://github.com/${GITHUB_REPOSITORY}/releases/download/${TAG_NAME}/${GCC}.tgz
echo ${URL}
if ! wget --spider ${URL} 2> /dev/null; then
echo BUILD=true >> ${GITHUB_ENV}
sed -i "s|EXTERNAL=y|EXTERNAL=n|g" ${CONFIG}
make BOARD=${CONFIG} br-sdk
SDK=$(find output/images -name *_sdk-buildroot.tar.gz)
mv ${SDK} ${GCC}.tgz
fi
- name: Build toolchain
if: env.BUILD
run: |
CONFIG=$(find br-ext-chip-* -name ${{matrix.platform}}_lite_defconfig)
sed -i "s|EXTERNAL=y|EXTERNAL=n|g" ${CONFIG}
make BOARD=${CONFIG} br-sdk
SDK=$(find output/images -name *_sdk-buildroot.tar.gz)
mv ${SDK} ${GCC}.tgz
- name: Upload toolchain
if: env.BUILD
uses: softprops/action-gh-release@v1
with:
tag_name: ${{env.TAG_NAME}}