Skip to content

Commit

Permalink
xUp
Browse files Browse the repository at this point in the history
  • Loading branch information
igorpecovnik committed Dec 29, 2023
1 parent a356083 commit 6af249e
Show file tree
Hide file tree
Showing 3 changed files with 247 additions and 110 deletions.
180 changes: 90 additions & 90 deletions .github/workflows/end-user1.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -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)
74 changes: 74 additions & 0 deletions .github/workflows/example.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: "Build generic Armbian X86 SDK"
on:
workflow_dispatch:
inputs:
armbian_upload:
type: choice
default: releases
description: 'Where to upload?'
required: false
options:
- workflow
- releases


jobs:

build:
name: "Build generic Armbian X86 SDK"
runs-on: ubuntu-latest
steps:

- name: Import GPG key
env:
GPG_KEY1: ${{ secrets.GPG_KEY1 }}
if: env.GPG_KEY1 != null
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_KEY1 }}
passphrase: ${{ secrets.GPG_PASSPHRASE1 }}

- name: "Checkout userpatches repo: armbian/os"
uses: actions/checkout@v4
with:
repository: armbian/os
fetch-depth: 0
clean: false
path: os

- name: Read version
run: |
cat os/stable.json | jq '.version' | sed "s/\"//g" | sed 's/^/VERSION_OVERRIDE=/' >> $GITHUB_ENV
- 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: "sha,img,xz" # compression method: sha,img,xz
armbian_version: "${{ env.VERSION_OVERRIDE }}" # version override
armbian_board: "uefi-x86" # build target from https://github.com/armbian/build/tree/main/config/boards

#- name: "Upload to workflow artifacts"
# if: ${{ inputs.armbian_upload == 'workflow' }}
# uses: actions/upload-artifact@v4
# with:
# name: armbian-artifacts
# path: ${{ env.ARMBIAN_SCRIPT_PATH }}

- uses: ncipollo/release-action@v1
#if: ${{ inputs.armbian_upload == 'releases' }}
with:
tag: "sdk"
name: "Armbian SDK"
artifacts: "${{ env.ARMBIAN_SCRIPT_PATH }}/output/images/*"
allowUpdates: true
removeArtifacts: true
replacesArtifacts: true
makeLatest: true
token: "${{ secrets.GITHUB_TOKEN }}"
body: |
Unofficial Armbian artifacts with [official tools](https://github.com/armbian/build)
Loading

0 comments on commit 6af249e

Please sign in to comment.