From c19c4a7409980dec7e864922f8cbd6807af91fcb Mon Sep 17 00:00:00 2001 From: Yurii Smetanka Date: Mon, 21 Oct 2024 02:17:54 +0200 Subject: [PATCH] build armbian --- .github/workflows/build-armbian.yml | 129 ++++++++++++++++++++++++++++ .github/workflows/publish.yml | 2 +- 2 files changed, 130 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build-armbian.yml diff --git a/.github/workflows/build-armbian.yml b/.github/workflows/build-armbian.yml new file mode 100644 index 00000000..7581980d --- /dev/null +++ b/.github/workflows/build-armbian.yml @@ -0,0 +1,129 @@ +name: "build armbian" + +on: + workflow_dispatch: + inputs: + armbian_kernel_branch: + type: choice + description: 'Kernel branch' + options: + - legacy + - current + - edge + default: 'current' + + armbian_ui: + type: choice + description: 'User interface (not all works)' + options: + - minimal + - server + - xfce + - gnome + - cinnamon + - i3-wm + - kde-plasma + default: 'server' + + armbian_version: + description: 'Version' + required: false + default: 'v24.11.0-trunk.303' + +jobs: + build: + runs-on: ubuntu-latest + steps: + # - uses: actions/checkout@v4 + # with: + # repository: 'armbian/build' + # ref: 'main' + + # - uses: armbian/build@v24.8.1 + # with: + # armbian_token: "${{ secrets.REPO_KEY }}" + # armbian_target: "build" + # armbian_release: "bookworm" + # armbian_kernel_branch: "${{inputs.armbian_kernel_branch}}" + # armbian_ui: "${{inputs.armbian_ui}}" + # armbian_board: "bananapim4zero" + # # armbian_version: "v24.11.0-trunk.303" + + - name: "Checkout Armbian os" + uses: actions/checkout@v4 + with: + repository: armbian/os + fetch-depth: 0 + clean: false + path: os + + - name: "Checkout Armbian build framework" + uses: actions/checkout@v4 + with: + repository: armbian/build + fetch-depth: 0 + clean: false + path: build + + - shell: bash + run: | + + # read version from upstream Armbian OS + cat os/stable.json | jq '.version' | sed "s/\"//g" | sed 's/^/ARMBIAN_VERSION=/' >> $GITHUB_ENV + [[ "${{ inputs.armbian_version }}" != '' ]] && echo "ARMBIAN_VERSION=${{ inputs.armbian_version }}" >> $GITHUB_ENV + # echo "ARMBIAN_VERSION=${{ inputs.armbian_version }}" >> $GITHUB_ENV + + # copy os userpatches and custom + mkdir -pv build/userpatches + rsync -av os/userpatches/. build/userpatches/ + + - shell: bash + run: | + + # userspace decode + if [[ "${{ inputs.armbian_ui }}" == minimal ]]; then + BUILD_DESKTOP="no" + BUILD_MINIMAL="yes" + elif [[ "${{ inputs.armbian_ui }}" == server ]]; then + BUILD_DESKTOP="no" + BUILD_MINIMAL="no" + else + BUILD_DESKTOP="yes" + BUILD_MINIMAL="no" + DESKTOP_ENVIRONMENT="${{ inputs.armbian_ui }}" + DESKTOP_APPGROUPS_SELECTED="" + DESKTOP_ENVIRONMENT_CONFIG_NAME="config_base" + fi + + # go to build folder and checkout + cd build + git checkout ${{ inputs.armbian_branch }} + + # execute build command + ./compile.sh "build" \ + REVISION="${{ env.ARMBIAN_VERSION }}" \ + BOARD="bananapim4zero" \ + BRANCH="${{ inputs.armbian_kernel_branch }}" \ + RELEASE="bookworm" \ + KERNEL_CONFIGURE="no" \ + BUILD_DESKTOP="${BUILD_DESKTOP}" \ + BUILD_MINIMAL="${BUILD_MINIMAL}" \ + DESKTOP_ENVIRONMENT="${DESKTOP_ENVIRONMENT}" \ + DESKTOP_APPGROUPS_SELECTED="${DESKTOP_APPGROUPS_SELECTED}" \ + DESKTOP_ENVIRONMENT_CONFIG_NAME="${DESKTOP_ENVIRONMENT_CONFIG_NAME}" \ + ENABLE_EXTENSIONS="" \ + COMPRESS_OUTPUTIMAGE="sha,img,xz" \ + SHARE_LOG="yes" \ + INSTALL_HEADERS="yes" \ ## to build nexmon and drivers later + EXPERT="yes" + + - uses: ncipollo/release-action@v1 + with: + tag: armbian-bpim4z-"${{ env.ARMBIAN_VERSION }}" + name: 'base armbian image' + artifacts: "build/output/images/*" + allowUpdates: true + removeArtifacts: false + replacesArtifacts: true + makeLatest: true + token: "${{ github.token }}" diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 6d53edfb..fc261a03 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -33,7 +33,7 @@ jobs: - name: Build ${{ matrix.name }} img file run: cd publish/build; ls -la .; pwd; make packer; make ${{ matrix.id }} - + - name: Change name of .img.xz to add version run: | sudo chown runner:docker "pwnagotchi-${{ matrix.id }}.img"