|
| 1 | +name: Create Experimental Release |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + init_arm64: |
| 7 | + type: boolean |
| 8 | + default: false |
| 9 | + description: "Create arm64 Init" |
| 10 | + init_x64: |
| 11 | + type: boolean |
| 12 | + default: false |
| 13 | + description: "Create x64 Init" |
| 14 | + init_x86: |
| 15 | + type: boolean |
| 16 | + default: false |
| 17 | + description: "Create x86 Init" |
| 18 | + kernel_arm64: |
| 19 | + type: boolean |
| 20 | + default: false |
| 21 | + description: "Create arm64 kernel" |
| 22 | + kernel_x64: |
| 23 | + type: boolean |
| 24 | + default: false |
| 25 | + description: "Create x64 kernel" |
| 26 | + kernel_x86: |
| 27 | + type: boolean |
| 28 | + default: false |
| 29 | + description: "Create x86 kernel" |
| 30 | + |
| 31 | +defaults: |
| 32 | + run: |
| 33 | + shell: bash |
| 34 | + |
| 35 | +jobs: |
| 36 | + input_checks: |
| 37 | + runs-on: ubuntu-22.04 |
| 38 | + |
| 39 | + steps: |
| 40 | + - name: Make at least one workflow input is selected |
| 41 | + run: | |
| 42 | + init_arm64="${{ inputs.init_arm64 }}" |
| 43 | + init_x64="${{ inputs.init_x64 }}" |
| 44 | + init_x86="${{ inputs.init_x86 }}" |
| 45 | + kernel_arm64="${{ inputs.kernel_arm64 }}" |
| 46 | + kernel_x64="${{ inputs.kernel_x64 }}" |
| 47 | + kernel_x86="${{ inputs.kernel_x86 }}" |
| 48 | +
|
| 49 | + if [ $init_arm64 == "" && $init_x64 == "" && $init_x86 == "" && $kernel_arm64 == "" && $kernel_x64 == "" && $kernel_x86 == "" ]; then |
| 50 | + echo "No kernel or init selected." |
| 51 | + fi |
| 52 | +
|
| 53 | + build_kernel_arm64: |
| 54 | + needs: input_checks |
| 55 | + |
| 56 | + if: ${{ inputs.kernel_arm64 }} |
| 57 | + runs-on: ubuntu-22.04 |
| 58 | + |
| 59 | + steps: |
| 60 | + - name: Checkout code |
| 61 | + uses: actions/checkout@v4 |
| 62 | + |
| 63 | + - name: Install dependencies |
| 64 | + run: sudo apt update && sudo apt install meld build-essential libncurses5-dev bison flex gcc-aarch64-linux-gnu libelf-dev -y |
| 65 | + |
| 66 | + - name: Build arm64 kernel |
| 67 | + run: ./build.sh -nka arm64 |
| 68 | + |
| 69 | + - name: Run sha256 checksum |
| 70 | + run: | |
| 71 | + cd dist |
| 72 | + sha256sum -c ./*.sha256 |
| 73 | + if [[ $? -ne 0 ]]; then exit 1; fi |
| 74 | +
|
| 75 | + - name: Save distribution files |
| 76 | + uses: actions/upload-artifact@v3 |
| 77 | + with: |
| 78 | + name: distribution-files |
| 79 | + path: dist |
| 80 | + retention-days: 1 |
| 81 | + |
| 82 | + build_kernel_x86: |
| 83 | + needs: input_checks |
| 84 | + |
| 85 | + if: ${{ inputs.kernel_x86 }} |
| 86 | + runs-on: ubuntu-22.04 |
| 87 | + |
| 88 | + steps: |
| 89 | + - name: Checkout code |
| 90 | + uses: actions/checkout@v4 |
| 91 | + |
| 92 | + - name: Install dependencies |
| 93 | + run: sudo apt update && sudo apt install meld build-essential libncurses5-dev bison flex gcc-aarch64-linux-gnu libelf-dev -y |
| 94 | + |
| 95 | + - name: Build x86 kernel |
| 96 | + run: ./build.sh -nka x86 |
| 97 | + |
| 98 | + - name: Run sha256 checksum |
| 99 | + run: | |
| 100 | + cd dist |
| 101 | + sha256sum -c ./*.sha256 |
| 102 | + if [[ $? -ne 0 ]]; then exit 1; fi |
| 103 | +
|
| 104 | + - name: Save distribution files |
| 105 | + uses: actions/upload-artifact@v3 |
| 106 | + with: |
| 107 | + name: distribution-files |
| 108 | + path: dist |
| 109 | + retention-days: 1 |
| 110 | + |
| 111 | + build_kernel_x64: |
| 112 | + needs: input_checks |
| 113 | + |
| 114 | + if: ${{ inputs.kernel_x64 }} |
| 115 | + runs-on: ubuntu-22.04 |
| 116 | + |
| 117 | + steps: |
| 118 | + - name: Checkout code |
| 119 | + uses: actions/checkout@v4 |
| 120 | + |
| 121 | + - name: Install dependencies |
| 122 | + run: sudo apt update && sudo apt install meld build-essential libncurses5-dev bison flex gcc-aarch64-linux-gnu libelf-dev -y |
| 123 | + |
| 124 | + - name: Build x64 kernel |
| 125 | + run: ./build.sh -nka x64 |
| 126 | + |
| 127 | + - name: Run sha256 checksum |
| 128 | + run: | |
| 129 | + cd dist |
| 130 | + sha256sum -c ./*.sha256 |
| 131 | + if [[ $? -ne 0 ]]; then exit 1; fi |
| 132 | +
|
| 133 | + - name: Save distribution files |
| 134 | + uses: actions/upload-artifact@v3 |
| 135 | + with: |
| 136 | + name: distribution-files |
| 137 | + path: dist |
| 138 | + retention-days: 1 |
| 139 | + |
| 140 | + build_initrd_arm64: |
| 141 | + needs: input_checks |
| 142 | + |
| 143 | + if: ${{ inputs.init_arm64 }} |
| 144 | + runs-on: ubuntu-22.04 |
| 145 | + |
| 146 | + steps: |
| 147 | + - name: Checkout code |
| 148 | + uses: actions/checkout@v4 |
| 149 | + |
| 150 | + - name: Install dependencies |
| 151 | + run: sudo apt update && sudo apt install meld build-essential libncurses5-dev bison flex gcc-aarch64-linux-gnu libelf-dev -y |
| 152 | + |
| 153 | + - name: Build arm64 initrd |
| 154 | + run: ./build.sh -nfa arm64 |
| 155 | + |
| 156 | + - name: Run sha256 checksum |
| 157 | + run: | |
| 158 | + cd dist |
| 159 | + sha256sum -c ./*.sha256 |
| 160 | + if [[ $? -ne 0 ]]; then exit 1; fi |
| 161 | +
|
| 162 | + - name: Save distribution files |
| 163 | + uses: actions/upload-artifact@v3 |
| 164 | + with: |
| 165 | + name: distribution-files |
| 166 | + path: dist |
| 167 | + retention-days: 1 |
| 168 | + |
| 169 | + - name: Save log file |
| 170 | + uses: actions/upload-artifact@v3 |
| 171 | + with: |
| 172 | + name: Buildroot-logs |
| 173 | + path: fssourcearm64/buildrootarm64.log |
| 174 | + retention-days: 30 |
| 175 | + |
| 176 | + build_initrd_x86: |
| 177 | + needs: input_checks |
| 178 | + |
| 179 | + if: ${{ inputs.init_x86 }} |
| 180 | + runs-on: ubuntu-22.04 |
| 181 | + |
| 182 | + steps: |
| 183 | + - name: Checkout code |
| 184 | + uses: actions/checkout@v4 |
| 185 | + |
| 186 | + - name: Install dependencies |
| 187 | + run: sudo apt update && sudo apt install meld build-essential libncurses5-dev bison flex gcc-aarch64-linux-gnu libelf-dev -y |
| 188 | + |
| 189 | + - name: Build x86 initrd |
| 190 | + run: ./build.sh -nfa x86 |
| 191 | + |
| 192 | + - name: Run sha256 checksum |
| 193 | + run: | |
| 194 | + cd dist |
| 195 | + sha256sum -c ./*.sha256 |
| 196 | + if [[ $? -ne 0 ]]; then exit 1; fi |
| 197 | +
|
| 198 | + - name: Save distribution files |
| 199 | + uses: actions/upload-artifact@v3 |
| 200 | + with: |
| 201 | + name: distribution-files |
| 202 | + path: dist |
| 203 | + retention-days: 1 |
| 204 | + |
| 205 | + - name: Save log file |
| 206 | + uses: actions/upload-artifact@v3 |
| 207 | + with: |
| 208 | + name: Buildroot-logs |
| 209 | + path: fssourcex86/buildrootx86.log |
| 210 | + retention-days: 30 |
| 211 | + |
| 212 | + build_initrd_x64: |
| 213 | + needs: input_checks |
| 214 | + |
| 215 | + if: ${{ inputs.init_x64 }} |
| 216 | + runs-on: ubuntu-22.04 |
| 217 | + |
| 218 | + steps: |
| 219 | + - name: Checkout code |
| 220 | + uses: actions/checkout@v4 |
| 221 | + |
| 222 | + - name: Install dependencies |
| 223 | + run: sudo apt update && sudo apt install meld build-essential libncurses5-dev bison flex gcc-aarch64-linux-gnu libelf-dev -y |
| 224 | + |
| 225 | + - name: Build x64 initrd |
| 226 | + run: ./build.sh -nfa x64 |
| 227 | + |
| 228 | + - name: Run sha256 checksum |
| 229 | + run: | |
| 230 | + cd dist |
| 231 | + sha256sum -c ./*.sha256 |
| 232 | + if [[ $? -ne 0 ]]; then exit 1; fi |
| 233 | +
|
| 234 | + - name: Save distribution files |
| 235 | + uses: actions/upload-artifact@v3 |
| 236 | + with: |
| 237 | + name: distribution-files |
| 238 | + path: dist |
| 239 | + retention-days: 1 |
| 240 | + |
| 241 | + - name: Save log file |
| 242 | + uses: actions/upload-artifact@v3 |
| 243 | + with: |
| 244 | + name: Buildroot-logs |
| 245 | + path: fssourcex64/buildrootx64.log |
| 246 | + retention-days: 30 |
| 247 | + |
| 248 | + release: |
| 249 | + needs: |
| 250 | + [ |
| 251 | + build_kernel_arm64, |
| 252 | + build_kernel_x86, |
| 253 | + build_kernel_x64, |
| 254 | + build_initrd_arm64, |
| 255 | + build_initrd_x86, |
| 256 | + build_initrd_x64, |
| 257 | + ] |
| 258 | + |
| 259 | + runs-on: ubuntu-22.04 |
| 260 | + |
| 261 | + steps: |
| 262 | + - name: Checkout code |
| 263 | + uses: actions/checkout@v4 |
| 264 | + |
| 265 | + - name: Download distribution files |
| 266 | + uses: actions/download-artifact@v4 |
| 267 | + |
| 268 | + - name: Set release name variable |
| 269 | + run: | |
| 270 | + echo "RELEASE_NAME=Experimental release from $(date '+%Y-%m-%d')" >> $GITHUB_ENV |
| 271 | + |
| 272 | + - name: Set tag name variable |
| 273 | + run: | |
| 274 | + echo "TAG_NAME=EXPERIMENTAL_$(date '+%Y%m%d')" >> $GITHUB_ENV |
| 275 | +
|
| 276 | + - name: Get Linux Kernel version from build.sh |
| 277 | + run: | |
| 278 | + echo "LINUX_KERNEL_VER=$(cat build.sh | sed -n -e 's/^.*KERNEL_VERSION=//p' | cut -d\' -f 2)" >> $GITHUB_ENV |
| 279 | +
|
| 280 | + - name: Get Buildroot version from build.sh |
| 281 | + run: | |
| 282 | + echo "BUILDROOT_VER=$(cat build.sh | sed -n -e 's/^.*BUILDROOT_VERSION=//p' | cut -d\' -f 2)" >> $GITHUB_ENV |
| 283 | +
|
| 284 | + # - name: Set release name and tag name variable if it is an Official FOG release |
| 285 | + # run: | |
| 286 | + # is_official="${{ inputs.is_official_release }}" |
| 287 | + # fog_version="${{ inputs.official_fog_version }}" |
| 288 | + # if [[ ${{ inputs.is_official_release }} == "true" ]]; then |
| 289 | + # echo "RELEASE_NAME=FOG $fog_version kernels and inits" >> $GITHUB_ENV |
| 290 | + # echo "TAG_NAME=$fog_version" >> $GITHUB_ENV |
| 291 | + # fi |
| 292 | + |
| 293 | + - name: Run sha256 checksum on all files |
| 294 | + run: | |
| 295 | + cd distribution-files |
| 296 | + sha256sum -c ./*.sha256 |
| 297 | + if [[ $? -ne 0 ]]; then exit 1; fi |
| 298 | + |
| 299 | + - name: Create release body |
| 300 | + run: | |
| 301 | + body_text="" |
| 302 | + if [ ${{ inputs.kernel_arm64 }} != "" || ${{ inputs.kernel_x64 }} != "" || ${{ inputs.kernel_x86 }} != "" ]; then |
| 303 | + body_text+="Linux kernel ${{ env.LINUX_KERNEL_VER}}" |
| 304 | + fi |
| 305 | + if [ ${{ inputs.init_arm64 }} != "" || ${{ inputs.init_x64 }} != "" || ${{ inputs.init_x86 }} != "" ]; then |
| 306 | + body_text+="\nBuildroot ${{ env.BUILDROOT_VER}}" |
| 307 | + fi |
| 308 | +
|
| 309 | + echo "RELEASE_BODY_TEXT=$(echo $body_text)" >> $GITHUB_ENV |
| 310 | +
|
| 311 | + - name: Create release |
| 312 | + uses: softprops/action-gh-release@v0.1.15 |
| 313 | + with: |
| 314 | + name: ${{ env.RELEASE_NAME }} |
| 315 | + body: ${{ env.RELEASE_BODY_TEXT }} |
| 316 | + tag_name: ${{ env.TAG_NAME }} |
| 317 | + files: | |
| 318 | + distribution-files/* |
0 commit comments