From c746ddb0af5b73bce2d7a83292f7d0167c36dc4a Mon Sep 17 00:00:00 2001 From: Igor Pecovnik Date: Fri, 29 Dec 2023 10:43:08 +0100 Subject: [PATCH] Up --- .github/workflows/end-user1.yml | 180 ++++++++++++++++---------------- .github/workflows/example.yml | 27 +++++ action.yml | 94 +++++++++++++---- 3 files changed, 190 insertions(+), 111 deletions(-) create mode 100644 .github/workflows/example.yml diff --git a/.github/workflows/end-user1.yml b/.github/workflows/end-user1.yml index c8ba78dc61f1..1e7ece76e575 100644 --- a/.github/workflows/end-user1.yml +++ b/.github/workflows/end-user1.yml @@ -1,22 +1,51 @@ -name: "Build images XXX" +name: "Build Armbian USERSPACE for HARDWARE" on: workflow_dispatch: inputs: - skipImages: - description: 'Skip building images? no = build images, yes = skip images' - required: true - options: [ 'yes', 'no' ] + + armbian_target: type: choice - default: 'no' - branch: + description: 'Build' + required: false + options: + - kernel + - image + + armbian_branch: type: choice description: 'Framework build branch' options: # branches - - main - - v23.11 - default: 'main' - board: + - legacy + - current + - edge + default: 'current' + + armbian_release: + type: choice + description: 'Userspace' + options: + # userspace + - jammy + - bookworm + - trixie + default: 'jammy' + + armbian_ui: + type: choice + description: 'User interface (not all combinations work)' + options: + # userspace + - minimal + - server + - xfce + - gnome + - cinnamon + - i3-wm + - kde-plasma + default: 'minimal' + + armbian_board: type: choice description: 'Board' options: @@ -77,93 +106,64 @@ on: - uefi-arm64 - uefi-x86 - xiaomi-elish - - 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: '' - build_runner: - description: 'GH runner' - required: false - default: 'ubuntu-latest' - -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 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 }}" + default: 'uefi-x86' - # 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 + armbian_version: + description: 'Version' + required: false + default: '23.11.1' jobs: build: - runs-on: ${{ inputs.BUILD_RUNNER }} + name: "Build Armbian" + runs-on: ubuntu-latest steps: - - name: Update - if: inputs.BUILD_RUNNER == 'ubuntu-latest' - run: | - sudo apt update - sudo apt -y clean + #- name: Update + # run: | + # sudo apt update + # sudo apt -y upgrade + # 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: 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 + - name: "Compile ${{ inputs.build_target }}" uses: igorpecovnik/build@main with: - build_target: kernel - kernel_source: ${{ inputs.kernel_source }} + armbian_target: "${{ inputs.armbian_target }}" + armbian_branch: "${{ inputs.armbian_branch }}" + armbian_release: "${{ inputs.armbian_release }}" + armbian_version: "${{ inputs.armbian_version }}" + armbian_ui: "${{ inputs.armbian_ui }}" + armbian_board: "${{ inputs.armbian_board }}" + + - name: Calculate upload path + run: | + if [[ "${{ inputs.armbian_target }}" == image ]]; then + echo "ARMBIAN_SCRIPT_PATH=${{ env.ARMBIAN_SCRIPT_PATH }}/output/images/" >> $GITHUB_ENV + else + echo "ARMBIAN_SCRIPT_PATH=${{ env.ARMBIAN_SCRIPT_PATH }}/output/debs/" >> $GITHUB_ENV + fi + + - uses: ncipollo/release-action@v1 + with: + tag: "artifacts" + name: "Armbian artifacts" + artifacts: "${{ env.ARMBIAN_SCRIPT_PATH }}*" + allowUpdates: true + removeArtifacts: true + replacesArtifacts: true + makeLatest: true + token: "${{ secrets.GITHUB_TOKEN }}" + body: | + Unofficial Armbian artifacts with [official tools](https://github.com/armbian/build) diff --git a/.github/workflows/example.yml b/.github/workflows/example.yml new file mode 100644 index 000000000000..c181eb5fea39 --- /dev/null +++ b/.github/workflows/example.yml @@ -0,0 +1,27 @@ +name: "Build generic Armbian X86 SDK" +on: + workflow_dispatch: + +jobs: + + build: + name: "Build generic Armbian X86 SDK" + runs-on: ubuntu-latest + steps: + + - name: "Build generic Armbian X86 SDK" + uses: igorpecovnik/build@main + with: + armbian_target: "image" # repace with `kernel` if you only want to build artifacts + armbian_branch: "current" # branch: legacy, current, edge, etc. + armbian_release: "jammy" # userspace: jammy, bookworm, trixie, etc. + armbian_ui: "minimal" # minimal, server, xfce, gnome, etc. + armbian_compress: "" # compression method: sha,img,xz + armbian_board: "uefi-x86" # build target from https://github.com/armbian/build/tree/main/config/boards + + - name: "Upload to workflow artifacts" + uses: actions/upload-artifact@v4 + with: + name: armbian-artifacts + path: | + "${{ env.ARMBIAN_SCRIPT_PATH }}/output/images/*" diff --git a/action.yml b/action.yml index a40ac13f52be..f59b3b6b9748 100644 --- a/action.yml +++ b/action.yml @@ -1,39 +1,91 @@ name: "Rebuild Armbian" author: "https://github.com/armbian" -description: "Build custom Linux for custom hardware" +description: "Build Armbian Linux" inputs: - # Select build target - build_target: - description: "Select build target: armbian / kernel" + + armbian_target: + description: "Build image or kernel" required: false - default: "armbian" - # Images - armbian_board: - description: "Set device Board." + default: "kernel" + + armbian_branch: + description: "Choose kernel branch" required: false - default: "all" - armbian_fstype: - description: "Set armbian rootfs type: ext4 / btrfs" + default: "current" + + armbian_release: + description: "Choose userspace release" required: false - default: "ext4" - builder_name: - description: "Set Armbian builder signature." + default: "jammy" + + armbian_version: + description: "Set different version" required: false default: "" - # Kernel - kernel_branch: - description: "Set the tags of the stable kernel." + + armbian_board: + description: "Select hardware platform" + required: false + default: "uefi-x86" + + armbian_ui: + description: "Armbian user interface" required: false - default: "stable" + default: "minimal" + + armbian_compress: + description: "Armbian compress method" + required: false + default: "" runs: using: "composite" steps: - 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 + + # compile image or kernel translation + BUILD_TARGET="${{ inputs.armbian_target }}" + [[ "${{ inputs.armbian_target }}" == image ]] && unset BUILD_TARGET + + # go to build folder cd ${GITHUB_ACTION_PATH} - ls -l + + # execute build command + ./compile.sh "${BUILD_TARGET}" \ + REVISION="${{ inputs.armbian_version }}" \ + BOARD="${{ inputs.armbian_board }}" \ + BRANCH="${{ inputs.armbian_branch }}" \ + RELEASE="${{ inputs.armbian_release }}" \ + 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}" \ + COMPRESS_OUTPUTIMAGE="${{ inputs.armbian_compress }}" \ + SHARE_LOG="yes" \ + EXPERT="yes" + + # save path + echo "ARMBIAN_SCRIPT_PATH=${GITHUB_ACTION_PATH}" >> $GITHUB_ENV branding: - icon: "terminal" - color: "gray-dark" + icon: "check" + color: "red" +