Skip to content

Commit

Permalink
Add optional board
Browse files Browse the repository at this point in the history
  • Loading branch information
ophub committed Oct 3, 2021
1 parent f9d3ba1 commit 9563082
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 11 deletions.
21 changes: 16 additions & 5 deletions .github/workflows/build-armbian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ name: Build Armbian For Amlogic
on:
repository_dispatch:
workflow_dispatch:
inputs:
set_board:
description: 'Optional: lepotato / odroidn2'
required: false
default: 'lepotato'
schedule:
- cron: '0 17 * * 0'

env:
ARMBIAN_BOARD: lepotato
ARMBIAN_HOST: armbian
UPLOAD_FIRMWARE: false
UPLOAD_RELEASE: true
DELETE_RELEASE: true
Expand Down Expand Up @@ -44,19 +47,27 @@ jobs:
sudo timedatectl set-timezone "$TZ"
sudo mkdir -p /workdir
sudo chown $USER:$GROUPS /workdir
ARR_BOARD=("lepotato" "odroidn2")
if [[ -n "${{ github.event.inputs.set_board }}" && -n "$(echo "${ARR_BOARD[@]}" | grep -w "${{ github.event.inputs.set_board }}")" ]]; then
set_board="${{ github.event.inputs.set_board }}"
else
set_board="lepotato"
fi
echo "ARMBIAN_BOARD=${set_board}" >> $GITHUB_ENV
echo "COMPILE_STARTINGTIME=$(date +"%Y.%m.%d.%H%M")" >> $GITHUB_ENV
- name: Download source code
id: down
run: |
git clone --depth 1 https://github.com/armbian/build.git
- name: Build Armbian
- name: Build Armbian [ ${{ env.ARMBIAN_BOARD }} ]
id: build
run: |
cd build/
sudo chmod +x compile.sh
sudo ./compile.sh BOARD="${{ env.ARMBIAN_BOARD }}" HOST="${{ env.ARMBIAN_HOST }}" BRANCH=current RELEASE=buster \
BUILD_MINIMAL=no BUILD_DESKTOP=no KERNEL_ONLY=no KERNEL_CONFIGURE=no COMPRESS_OUTPUTIMAGE=sha,img
sudo ./compile.sh BOARD="${{ env.ARMBIAN_BOARD }}" HOST=armbian BRANCH=current RELEASE=buster BUILD_MINIMAL=no \
BUILD_DESKTOP=no KERNEL_ONLY=no KERNEL_CONFIGURE=no COMPRESS_OUTPUTIMAGE=sha,img
echo "::set-output name=status::success"
- name: Make Armbian for amlogic s9xxx
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/use-releases-file-to-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
if: (!cancelled())
run: |
[ -d build/output/images ] || mkdir -p build/output/images
curl -s "https://api.github.com/repos/${GITHUB_REPOSITORY}/releases" | grep -o "Armbian_Aml_buster_.*/Armbian_.*_Lepotato_.*.img.gz" | head -n 1 > DOWNLOAD_ARMBIAN
curl -s "https://api.github.com/repos/${GITHUB_REPOSITORY}/releases" | grep -o "Armbian_Aml_buster_.*/Armbian_.*-trunk_.*.img.gz" | head -n 1 > DOWNLOAD_ARMBIAN
[ -s DOWNLOAD_ARMBIAN ] && wget -q -P build/output/images https://github.com/${GITHUB_REPOSITORY}/releases/download/$(cat DOWNLOAD_ARMBIAN)
cd ./build/output/images && gzip -df *.img.gz && sync && cd ../../../
sudo chmod +x make
Expand Down
2 changes: 1 addition & 1 deletion README.cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ armbian-update 5.10.66

2. 全新编译:在 [Action](https://github.com/ophub/amlogic-s9xxx-armbian/actions) 页面里选择 ***`Build Armbian For Amlogic`*** ,点击 ***`Run workflow`*** 按钮即可编译。

3. 再次编译:如果 [Releases](https://github.com/ophub/amlogic-s9xxx-armbian/releases) 中有已经编译好的 `Armbian_.*_Lepotato_.*.img.gz` 文件,你只是想再次制作其他不同 soc 的盒子,可以跳过 Armbian 源文件的编译,直接进行二次制作。在 [Action](https://github.com/ophub/amlogic-s9xxx-armbian/actions) 页面中选择 ***`Use Releases file to build`*** ,点击 ***`Run workflow`*** 按钮即可二次编译。
3. 再次编译:如果 [Releases](https://github.com/ophub/amlogic-s9xxx-armbian/releases) 中有已经编译好的 `Armbian_.*-trunk_.*.img.gz` 文件,你只是想再次制作其他不同 soc 的盒子,可以跳过 Armbian 源文件的编译,直接进行二次制作。在 [Action](https://github.com/ophub/amlogic-s9xxx-armbian/actions) 页面中选择 ***`Use Releases file to build`*** ,点击 ***`Run workflow`*** 按钮即可二次编译。

- ### 本地化打包

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ armbian-update 5.10.66

2. New compilation: Select ***`Build Armbian For Amlogic`*** on the [Action](https://github.com/ophub/amlogic-s9xxx-armbian/actions) page. Click the ***`Run workflow`*** button.

3. Compile again: If there is an `Armbian_.*_Lepotato_.*.img.gz` file in [Releases](https://github.com/ophub/amlogic-s9xxx-armbian/releases), you do not need to compile it completely, you can directly use this file to `build armbian` of different soc. Select ***`Use Releases file to build`*** on the [Action](https://github.com/ophub/amlogic-s9xxx-armbian/actions) page. Click the ***`Run workflow`*** button.
3. Compile again: If there is an `Armbian_.*-trunk_.*.img.gz` file in [Releases](https://github.com/ophub/amlogic-s9xxx-armbian/releases), you do not need to compile it completely, you can directly use this file to `build armbian` of different soc. Select ***`Use Releases file to build`*** on the [Action](https://github.com/ophub/amlogic-s9xxx-armbian/actions) page. Click the ***`Run workflow`*** button.

- ### Local make instructions

Expand Down
6 changes: 3 additions & 3 deletions make
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ make_image() {
mkdir -p ${tmp_armbian} ${tmp_build} ${tmp_outpath} ${tmp_aml_image} && sync

# Get armbian version and release
armbian_image_name=$(ls ${armbian_outputpath}/*_Lepotato_*.img 2>/dev/null | awk -F "/Armbian_" '{print $2}')
armbian_image_name=$(ls ${armbian_outputpath}/*-trunk_*.img 2>/dev/null | awk -F "/Armbian_" '{print $2}')
out_release=$(echo ${armbian_image_name} | awk -F "buster" '{print $1}' | grep -oE '[1-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}' 2>/dev/null)
out_version=$(echo ${armbian_image_name} | awk -F "buster" '{print $NF}' | grep -oE '[1-9].[0-9]{1,3}.[0-9]{1,3}' 2>/dev/null)
[[ -n "${out_release}" && -n "${out_version}" ]] || die "Invalid file: ${armbian_outputpath}/*_Lepotato_*.img"
[[ -n "${out_release}" && -n "${out_version}" ]] || die "Invalid file: ${armbian_outputpath}/*-trunk_*.img"
if [ -n "${new_kernel}" ]; then
make_version=${new_kernel}
else
Expand Down Expand Up @@ -160,7 +160,7 @@ extract_armbian() {

armbian_image_file="${tmp_aml_image}/armbian_${build_soc}_${make_version}.img"
rm -f ${armbian_image_file} 2>/dev/null && sync
cp -f $( ls ${armbian_outputpath}/*_Lepotato_*.img 2>/dev/null | head -n 1 ) ${armbian_image_file}
cp -f $( ls ${armbian_outputpath}/*-trunk_*.img 2>/dev/null | head -n 1 ) ${armbian_image_file}
sync && sleep 3

loop_old=$(losetup -P -f --show "${armbian_image_file}")
Expand Down

0 comments on commit 9563082

Please sign in to comment.