From 7c62ee0b665d9932c7298853354a9f9de2e7d514 Mon Sep 17 00:00:00 2001 From: Igor Pecovnik Date: Fri, 29 Dec 2023 10:14:08 +0100 Subject: [PATCH] Add action --- .github/workflows/end-user.yml | 236 +++++++++++++++++++++++++++++++++ action.yml | 39 ++++++ 2 files changed, 275 insertions(+) create mode 100644 .github/workflows/end-user.yml create mode 100644 action.yml diff --git a/.github/workflows/end-user.yml b/.github/workflows/end-user.yml new file mode 100644 index 000000000000..c2105dd13cff --- /dev/null +++ b/.github/workflows/end-user.yml @@ -0,0 +1,236 @@ +name: "Build images" +on: + workflow_dispatch: + inputs: + skipImages: + description: 'Skip building images? no = build images, yes = skip images' + required: true + options: [ 'yes', 'no' ] + type: choice + default: 'no' + checkOci: + description: 'Check OCI for existing artifacts? yes = check OCI, no = always build everything' + required: true + options: [ 'yes', 'no' ] + type: choice + default: 'yes' + extraParamsAllBuilds: + description: 'Extra params for all builds/jobs (prepare/artifact/image) (eg: DEBUG=yes)' + required: false + default: '' + type: string + branch: + type: choice + description: 'Framework build branch' + options: + # branches + - main + - v23.11 + default: 'main' + board: + type: choice + description: 'Board' + options: + # boards + - bananapicm4io + - bananapim2pro + - bananapim2s + - bananapim5 + - bigtreetech-cb1 + - jethubj100 + - jethubj80 + - khadas-edge2 + - khadas-vim1 + - khadas-vim1s + - khadas-vim2 + - khadas-vim3 + - khadas-vim3l + - khadas-vim4 + - lafrite + - lepotato + - nanopi-r4s + - nanopi-r6s + - nanopiduo + - nanopiduo2 + - odroidc2 + - odroidm1 + - odroidn2 + - odroidxu4 + - olimex-teres-a64 + - onecloud + - orangepi-r1 + - orangepi-r1plus-lts + - orangepi4-lts + - orangepi5-plus + - orangepi5 + - orangepione + - orangepiprime + - orangepizero + - orangepizero2 + - orangepizeroplus + - pine64 + - pinebook-pro + - radxa-zero + - renegade + - rock-3a + - rock-5b + - rockpi-4a + - rockpi-e + - rockpro64 + - rpi4b + - rpi5b + - sk-am62b + - sk-am64b + - sk-tda4vm + - tinkerboard + - tritium-h3 + - tritium-h5 + - uefi-arm64 + - uefi-x86 + - xiaomi-elish + - all + default: 'all' + maintainer: + type: choice + description: 'Maintainer' + options: + # maintainers + - 150balbes + - 1ubuntuuser + - AGM1968 + - AaronNGray + - DylanHP + - Kreyren + - ManoftheSea + - Manouchehri + - NicoD-SBC + - PanderMusubi + - StephenGraf + - TRSx80 + - Tonymac32 + - Z-Keven + - ZazaBR + - adeepn + - ahoneybun + - amazingfate + - bigtreetech + - brentr + - bretmlw + - catalinii + - chainsx + - clee + - devdotnetorg + - echatzip + - efectn + - eliasbakken + - engineer-80 + - glneo + - hoochiwetech + - hzyitc + - igorpecovnik + - jeanrhum + - joekhoobyar + - joshaspinall + - krachlatte + - lanefu + - lbmendes + - linhz0hz + - mahdichi + - monkaBlyat + - paolosabatino + - pyavitz + - rpardini + - schwar3kat + - sgjava + - sputnik2019 + - teknoid + - utlark + - vamzii + - viraniac + - all + default: 'all' + targetsFilterInclude: + description: 'TARGETS_FILTER_INCLUDE, example: "BOARD:odroidhc4,BOARD:odroidn2"' + required: false + default: '' + type: string + nightlybuild: + description: 'yes = nighlty, no = stable' + required: false + options: [ 'yes', 'no' ] + type: choice + default: 'no' + uploadtoserver: + description: 'CDN upload github = releases, armbian = rsync.armbian.com' + required: false + options: [ 'github', 'armbian', 'both' ] + type: choice + default: 'armbian' + versionOverride: + description: 'Version override. Leave empty for automatic bump' + required: false + default: '' + +env: + + # For easier reuse across the multiple chunks ('armbian/build' repo) + BUILD_REPOSITORY: "armbian/build" + BUILD_REF: "${{ inputs.ref || inputs.branch || 'main' }}" # branch or tag or sha1 + + # For easier reuse across the multiple chunks ('armbian/os' repo) + USERPATCHES_REPOSITORY: "armbian/os" + USERPATCHES_REF: "main" # branch or tag or sha1 + USERPATCHES_DIR: "userpatches" # folder inside USERPATCHES_REPOSITORY + + # Github repository for releases. Normally its the one where we executing script + RELEASE_REPOSITORY: "os" + + # Armbian envs. Adjust to your needs. + # This makes builds faster, but only if the Docker images are up-to-date with all dependencies, Python, tools, etc. Otherwise it makes it... slower. + DOCKER_SKIP_UPDATE: "yes" # Do not apt update/install/requirements/etc during Dockerfile build, trust that Docker images are up-to-date. + + # Added to every build, even the prepare job. + EXTRA_PARAMS_ALL_BUILDS: "${{ inputs.extraParamsAllBuilds || 'UPLOAD_TO_OCI_ONLY=yes' }}" + + VERSION_OVERRIDE: "${{ github.event.inputs.versionOverride }}" + + # To use GitHub CLI in a GitHub Actions workflow + GH_TOKEN: "${{ secrets.ACCESS_TOKEN }}" + + # Added to every image build arguments. + EXTRA_PARAMS_IMAGE: "COMPRESS_OUTPUTIMAGE=xz,sha SHOW_DEBIAN=yes SHARE_LOG=yes " + +# To ensure that only a single workflow using the same concurrency group will run at a time +concurrency: + group: ${{ github.run_id }}-standard-supportstable + cancel-in-progress: false + +jobs: + + name: "M" + runs-on: ${{ inputs.BUILD_RUNNER }} + steps: + + - name: Update + if: inputs.BUILD_RUNNER == 'ubuntu-latest' + run: | + sudo apt update + sudo apt -y clean + + - name: Free Github Runner + if: inputs.BUILD_RUNNER == 'ubuntu-latest' + uses: descriptinc/free-disk-space@main + with: + android: true + dotnet: true + haskell: true + large-packages: true + docker-images: true + swap-storage: true + + - name: Compile the kernel + uses: igorpecovnik/build@main + if: !cancelled() + with: + build_target: kernel + kernel_source: ${{ inputs.kernel_source }} diff --git a/action.yml b/action.yml new file mode 100644 index 000000000000..a40ac13f52be --- /dev/null +++ b/action.yml @@ -0,0 +1,39 @@ +name: "Rebuild Armbian" +author: "https://github.com/armbian" +description: "Build custom Linux for custom hardware" +inputs: + # Select build target + build_target: + description: "Select build target: armbian / kernel" + required: false + default: "armbian" + # Images + armbian_board: + description: "Set device Board." + required: false + default: "all" + armbian_fstype: + description: "Set armbian rootfs type: ext4 / btrfs" + required: false + default: "ext4" + builder_name: + description: "Set Armbian builder signature." + required: false + default: "" + # Kernel + kernel_branch: + description: "Set the tags of the stable kernel." + required: false + default: "stable" + +runs: + using: "composite" + steps: + - shell: bash + run: | + cd ${GITHUB_ACTION_PATH} + ls -l + +branding: + icon: "terminal" + color: "gray-dark"