|
| 1 | +name: "Rebuild Armbian" |
| 2 | +author: "https://github.com/armbian" |
| 3 | +description: "Build Armbian Linux" |
| 4 | +inputs: |
| 5 | + |
| 6 | + armbian_token: |
| 7 | + description: "GitHub installation access token" |
| 8 | + required: true |
| 9 | + |
| 10 | + armbian_runner_clean: |
| 11 | + description: "Make some space on GH runners" |
| 12 | + required: false |
| 13 | + default: "" |
| 14 | + |
| 15 | + armbian_artifacts: |
| 16 | + descriptions: "Upload PATH" |
| 17 | + required: false |
| 18 | + default: "build/output/images/" |
| 19 | + |
| 20 | + armbian_target: |
| 21 | + description: "Build image or kernel" |
| 22 | + required: false |
| 23 | + default: "kernel" |
| 24 | + |
| 25 | + armbian_branch: |
| 26 | + description: "Choose framework branch" |
| 27 | + required: false |
| 28 | + default: "main" |
| 29 | + |
| 30 | + armbian_kernel_branch: |
| 31 | + description: "Choose kernel branch" |
| 32 | + required: false |
| 33 | + default: "current" |
| 34 | + |
| 35 | + armbian_release: |
| 36 | + description: "Choose userspace release" |
| 37 | + required: false |
| 38 | + default: "jammy" |
| 39 | + |
| 40 | + armbian_version: |
| 41 | + description: "Set different version" |
| 42 | + required: false |
| 43 | + default: "" |
| 44 | + |
| 45 | + armbian_board: |
| 46 | + description: "Select hardware platform" |
| 47 | + required: false |
| 48 | + default: "uefi-x86" |
| 49 | + |
| 50 | + armbian_ui: |
| 51 | + description: "Armbian user interface" |
| 52 | + required: false |
| 53 | + default: "server" |
| 54 | + |
| 55 | + armbian_compress: |
| 56 | + description: "Armbian compress method" |
| 57 | + required: false |
| 58 | + default: "sha,img,xz" |
| 59 | + |
| 60 | + armbian_extensions: |
| 61 | + description: "Armbian lists of extensions" |
| 62 | + required: false |
| 63 | + default: "" |
| 64 | + |
| 65 | + armbian_userpatches: |
| 66 | + description: "Armbian userpatches path" |
| 67 | + required: false |
| 68 | + default: "" |
| 69 | + |
| 70 | + armbian_pgp_key: |
| 71 | + description: "Armbian PGP key" |
| 72 | + required: false |
| 73 | + default: "" |
| 74 | + |
| 75 | + armbian_pgp_password: |
| 76 | + description: "Armbian PGP password" |
| 77 | + required: false |
| 78 | + default: "" |
| 79 | + |
| 80 | + armbian_release_tittle: |
| 81 | + description: "Armbian image" |
| 82 | + required: false |
| 83 | + default: "Armbian image" |
| 84 | + |
| 85 | + armbian_release_body: |
| 86 | + description: "Armbian images" |
| 87 | + required: false |
| 88 | + default: "Build with [Armbian tools](https://github.com/armbian/build)" |
| 89 | + |
| 90 | +runs: |
| 91 | + using: "composite" |
| 92 | + |
| 93 | + steps: |
| 94 | + |
| 95 | + - name: Free Github Runner |
| 96 | + if: ${{ inputs.armbian_runner_clean != '' }} |
| 97 | + uses: descriptinc/free-disk-space@main |
| 98 | + with: |
| 99 | + android: true |
| 100 | + dotnet: true |
| 101 | + haskell: true |
| 102 | + large-packages: true |
| 103 | + docker-images: true |
| 104 | + swap-storage: true |
| 105 | + |
| 106 | + - name: "Import GPG key" |
| 107 | + if: ${{ inputs.armbian_pgp_key != '' }} |
| 108 | + uses: crazy-max/ghaction-import-gpg@v6 |
| 109 | + with: |
| 110 | + gpg_private_key: ${{ inputs.armbian_pgp_key }} |
| 111 | + passphrase: ${{ inputs.armbian_pgp_password }} |
| 112 | + |
| 113 | + - name: "Checkout Armbian os" |
| 114 | + uses: actions/checkout@v4 |
| 115 | + with: |
| 116 | + repository: armbian/os |
| 117 | + fetch-depth: 0 |
| 118 | + clean: false |
| 119 | + path: os |
| 120 | + |
| 121 | + - name: "Checkout Armbian build framework" |
| 122 | + uses: actions/checkout@v4 |
| 123 | + with: |
| 124 | + repository: armbian/build |
| 125 | + fetch-depth: 0 |
| 126 | + clean: false |
| 127 | + path: build |
| 128 | + |
| 129 | + - name: "Checkout customisations" |
| 130 | + uses: actions/checkout@v4 |
| 131 | + with: |
| 132 | + fetch-depth: 0 |
| 133 | + clean: false |
| 134 | + path: custom |
| 135 | + |
| 136 | + - shell: bash |
| 137 | + run: | |
| 138 | +
|
| 139 | + # read version from upstream Armbian OS |
| 140 | + cat os/stable.json | jq '.version' | sed "s/\"//g" | sed 's/^/ARMBIAN_VERSION=/' >> $GITHUB_ENV |
| 141 | + [[ "${{ inputs.armbian_version }}" != '' ]] && echo "ARMBIAN_VERSION=${{ inputs.armbian_version }}" >> $GITHUB_ENV |
| 142 | +
|
| 143 | + # copy os userpatches and custom |
| 144 | + mkdir -pv build/userpatches |
| 145 | + rsync -av os/userpatches/. build/userpatches/ |
| 146 | + #[[ -d custom/userpatches ]] && |
| 147 | + rsync -av custom/userpatches/. build/userpatches/ |
| 148 | +
|
| 149 | + - shell: bash |
| 150 | + run: | |
| 151 | +
|
| 152 | + # userspace decode |
| 153 | + if [[ "${{ inputs.armbian_ui }}" == minimal ]]; then |
| 154 | + BUILD_DESKTOP="no" |
| 155 | + BUILD_MINIMAL="yes" |
| 156 | + elif [[ "${{ inputs.armbian_ui }}" == server ]]; then |
| 157 | + BUILD_DESKTOP="no" |
| 158 | + BUILD_MINIMAL="no" |
| 159 | + else |
| 160 | + BUILD_DESKTOP="yes" |
| 161 | + BUILD_MINIMAL="no" |
| 162 | + DESKTOP_ENVIRONMENT="${{ inputs.armbian_ui }}" |
| 163 | + DESKTOP_APPGROUPS_SELECTED="" |
| 164 | + DESKTOP_ENVIRONMENT_CONFIG_NAME="config_base" |
| 165 | + fi |
| 166 | +
|
| 167 | + # go to build folder and checkout |
| 168 | + cd build |
| 169 | + git checkout ${{ inputs.armbian_branch }} |
| 170 | +
|
| 171 | + # execute build command |
| 172 | + ./compile.sh "${{ inputs.armbian_target }}" \ |
| 173 | + REVISION="${{ env.ARMBIAN_VERSION }}" \ |
| 174 | + BOARD="${{ inputs.armbian_board }}" \ |
| 175 | + BRANCH="${{ inputs.armbian_kernel_branch }}" \ |
| 176 | + RELEASE="${{ inputs.armbian_release }}" \ |
| 177 | + KERNEL_CONFIGURE="no" \ |
| 178 | + BUILD_DESKTOP="${BUILD_DESKTOP}" \ |
| 179 | + BUILD_MINIMAL="${BUILD_MINIMAL}" \ |
| 180 | + DESKTOP_ENVIRONMENT="${DESKTOP_ENVIRONMENT}" \ |
| 181 | + DESKTOP_APPGROUPS_SELECTED="${DESKTOP_APPGROUPS_SELECTED}" \ |
| 182 | + DESKTOP_ENVIRONMENT_CONFIG_NAME="${DESKTOP_ENVIRONMENT_CONFIG_NAME}" \ |
| 183 | + ENABLE_EXTENSIONS="${{ inputs.armbian_extensions }}" \ |
| 184 | + COMPRESS_OUTPUTIMAGE="${{ inputs.armbian_compress }}" \ |
| 185 | + SHARE_LOG="yes" \ |
| 186 | + EXPERT="yes" |
| 187 | +
|
| 188 | + - name: Sign |
| 189 | + shell: bash |
| 190 | + if: ${{ inputs.armbian_pgp_password != '' }} |
| 191 | + run: | |
| 192 | + echo ${{ inputs.armbian_pgp_password }} | \ |
| 193 | + gpg --passphrase-fd 0 --armor --detach-sign --pinentry-mode loopback --batch --yes \ |
| 194 | + build/output/images/*.img*.xz |
| 195 | +
|
| 196 | + - uses: ncipollo/release-action@v1 |
| 197 | + with: |
| 198 | + tag: "${{ env.ARMBIAN_VERSION }}" |
| 199 | + name: "${{ inputs.armbian_release_tittle }}" |
| 200 | + artifacts: "${{ inputs.armbian_artifacts }}*" |
| 201 | + allowUpdates: true |
| 202 | + removeArtifacts: false |
| 203 | + replacesArtifacts: true |
| 204 | + makeLatest: true |
| 205 | + token: "${{ inputs.armbian_token }}" |
| 206 | + body: | |
| 207 | + ${{ inputs.armbian_release_body }} |
| 208 | +
|
| 209 | +branding: |
| 210 | + icon: "check" |
| 211 | + color: "red" |
| 212 | + |
0 commit comments