From 58e2160ae406ae8fd43b9cf2886cdc750d80b001 Mon Sep 17 00:00:00 2001 From: Igor Pecovnik Date: Sat, 30 Dec 2023 09:19:08 +0100 Subject: [PATCH] Add checkouts --- action.yml | 101 ++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 88 insertions(+), 13 deletions(-) diff --git a/action.yml b/action.yml index b71b574d22f0..edc79f327321 100644 --- a/action.yml +++ b/action.yml @@ -3,12 +3,21 @@ author: "https://github.com/armbian" description: "Build Armbian Linux" inputs: + armbian_token: + description: "GitHub installation access token" + required: true + armbian_target: description: "Build image or kernel" required: false default: "kernel" armbian_branch: + description: "Choose framework branch" + required: false + default: "main" + + armbian_kernel_branch: description: "Choose kernel branch" required: false default: "current" @@ -48,10 +57,63 @@ inputs: required: false default: "" + armbian_pgp_key: + description: "Armbian PGP key" + required: false + default: "" + + armbian_pgp_password: + description: "Armbian PGP password" + required: false + default: "" + runs: using: "composite" steps: + + - name: "Import GPG key" + if: ${{ inputs.armbian_pgp_key != '' }} + uses: crazy-max/ghaction-import-gpg@v6 + with: + gpg_private_key: ${{ inputs.armbian_pgp_key }} + passphrase: ${{ inputs.armbian_pgp_password }} + + - 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 + + - name: "Checkout customisations" + uses: actions/checkout@v4 + with: + fetch-depth: 0 + clean: false + path: custom + + - 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 + + # copy os userpatches and custom + mkdir -pv build/userpatches + rsync -av os/userpatches/. build/userpatches/ + [[ -d custom/userpatches ]] && rsync -av custom/userpatches/. build/userpatches/ + - shell: bash run: | @@ -70,18 +132,15 @@ runs: 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} + cd build + git checkout ${{ inputs.armbian_branch }} # execute build command - ./compile.sh "${BUILD_TARGET}" \ - REVISION="${{ inputs.armbian_version }}" \ + ./compile.sh "${{ inputs.armbian_target }}" \ + REVISION="${{ env.ARMBIAN_VERSION }}" \ BOARD="${{ inputs.armbian_board }}" \ - BRANCH="${{ inputs.armbian_branch }}" \ + BRANCH="${{ inputs.armbian_kernel_branch }}" \ RELEASE="${{ inputs.armbian_release }}" \ KERNEL_CONFIGURE="no" \ BUILD_DESKTOP="${BUILD_DESKTOP}" \ @@ -89,15 +148,31 @@ runs: DESKTOP_ENVIRONMENT="${DESKTOP_ENVIRONMENT}" \ DESKTOP_APPGROUPS_SELECTED="${DESKTOP_APPGROUPS_SELECTED}" \ DESKTOP_ENVIRONMENT_CONFIG_NAME="${DESKTOP_ENVIRONMENT_CONFIG_NAME}" \ - USERPATCHES_PATH="${{ inputs.armbian_userpatches }}" \ ENABLE_EXTENSIONS="${{ inputs.armbian_extensions }}" \ COMPRESS_OUTPUTIMAGE="${{ inputs.armbian_compress }}" \ SHARE_LOG="yes" \ - EXPERT="yes" \ - PREFER_DOCKER="no" + EXPERT="yes" - # save path - echo "ARMBIAN_SCRIPT_PATH=${GITHUB_ACTION_PATH}" >> $GITHUB_ENV + - name: Sign + shell: bash + if: ${{ inputs.armbian_pgp_password != '' }} + run: | + echo ${{ inputs.armbian_pgp_password }} | \ + gpg --passphrase-fd 0 --armor --detach-sign --pinentry-mode loopback --batch --yes \ + build/output/images/*.img*.xz + + - uses: ncipollo/release-action@v1 + with: + tag: "${{ env.ARMBIAN_VERSION }}" + name: "Armbian SDK" + artifacts: "build/output/images/*" + allowUpdates: true + removeArtifacts: true + replacesArtifacts: true + makeLatest: true + token: "${{ inputs.armbian_token }}" + body: | + Unofficial Armbian artifacts with [official tools](https://github.com/armbian/build) branding: icon: "check"