Skip to content

Commit

Permalink
Up
Browse files Browse the repository at this point in the history
  • Loading branch information
igorpecovnik committed Dec 29, 2023
1 parent a356083 commit ed1433d
Show file tree
Hide file tree
Showing 2 changed files with 126 additions and 110 deletions.
169 changes: 80 additions & 89 deletions .github/workflows/end-user1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,44 @@ name: "Build images XXX"
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
default: 'jammy'

armbian_minimal:
type: choice
description: 'Minimal image'
options:
# userspace
- yes
- no
default: 'yes'

armbian_board:
type: choice
description: 'Board'
options:
Expand Down Expand Up @@ -77,93 +100,61 @@ 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

- 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_minimal: "${{ inputs.armbian_minimal }}"
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: "Armbian ${{ inputs.build_target }}"
artifacts: "${{ env.ARMBIAN_SCRIPT_PATH }}*"
omitBody: true
omitName: true
allowUpdates: true
removeArtifacts: true
makeLatest: true
token: "${{ secrets.GITHUB_TOKEN }}"
67 changes: 46 additions & 21 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,64 @@
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: "stable"
default: "uefi-x86"

armbian_minimal:
description: "Minimal image"
required: false
default: "yes"

runs:
using: "composite"
steps:
- shell: bash
run: |
# translations for easier handling
BUILD_TARGET="${{ inputs.build_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="no" \
BUILD_MINIMAL="${{ inputs.armbian_minimal }}" \
COMPRESS_OUTPUTIMAGE="sha,img,xz" \
EXPERT="yes"
branding:
icon: "terminal"
color: "gray-dark"
icon: "check"
color: "red"

0 comments on commit ed1433d

Please sign in to comment.