build #137
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: build | |
| # ATTENTION: NOTICE: FURTHER: Development roadmap for better ensuring a consistent kernel build compiler toolchain would be to add '_chroot lite' functions or exported environment variable to chroot without using a separate filesystem/loopback, etc. Either 'debootstrap', or 'Live ISO' (similar to AppImage build process) would be used to create a very minimal chroot environment sufficient for kernel compiling, at minimal disk space consumption, etc. | |
| # For the shorter term, docker container experiments are used for the same purpose. | |
| # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions | |
| permissions: | |
| actions: write | |
| checks: read | |
| contents: write | |
| deployments: read | |
| issues: read | |
| packages: read | |
| pull-requests: read | |
| repository-projects: read | |
| security-events: none | |
| statuses: read | |
| # TODO: Add SLTS (and any needed fetch procedure) after 6.1 and 6.6 are no longer supported as LTS (6.1 SLTS expected to remain supported until 2033). | |
| # https://en.wikipedia.org/wiki/Linux_kernel_version_history | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| runnerName: | |
| required: false | |
| default: ubuntu-22.04 | |
| type: choice | |
| options: | |
| - ubuntu-22.04 | |
| - ubuntu-22.04-m | |
| - ubuntu-22.04-h | |
| forceKernel_mainline: | |
| required: false | |
| default: 6.12. | |
| type: choice | |
| options: | |
| - latest | |
| - 6.12. | |
| - none | |
| forceKernel_mainline_server: | |
| required: false | |
| default: 6.12. | |
| type: choice | |
| options: | |
| - latest | |
| - 6.12. | |
| - none | |
| forceKernel_lts: | |
| required: false | |
| default: 6.12. | |
| type: choice | |
| options: | |
| - latest | |
| - 6.12. | |
| - none | |
| forceKernel_lts_server: | |
| required: false | |
| default: none | |
| type: choice | |
| options: | |
| - latest | |
| - 6.12. | |
| - none | |
| skimfast: | |
| type: boolean | |
| default: false | |
| container: | |
| required: false | |
| default: docker | |
| type: choice | |
| options: | |
| - docker | |
| - none | |
| # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule | |
| schedule: | |
| #- cron: '5 1 * * 6' | |
| #- cron: '5 1 * * 2,4' | |
| #- cron: '5 1 * * 2' | |
| #- cron: '5 1 * * 4' | |
| #- cron: '25 6 1 * *' | |
| - cron: '25 2 25 * *' | |
| # https://docs.github.com/en/actions/using-jobs/using-concurrency | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build_lts: | |
| if: ${{ github.event.inputs.forceKernel_lts != 'none' }} | |
| runs-on: ${{ github.event.inputs.runnerName == '' && 'ubuntu-22.04' || github.event.inputs.runnerName }} | |
| steps: | |
| - name: forceKernel_lts-${{ github.event.inputs.forceKernel_lts }} ______________________________ | |
| shell: bash | |
| run: | | |
| true | |
| - name: users | |
| shell: bash | |
| run: | | |
| sudo -u ubuntu -n bash -c 'sudo -n useradd runner --non-unique -u $UID -g $UID' || true | |
| sudo -u ubuntu -n bash -c 'sudo -n groupadd runner --non-unique -g $UID' || true | |
| sudo -u runner -n bash -c 'sudo -n echo $USER $UID' || true | |
| true | |
| # Apparently may increase buildJet 'runner' to 77GB (instead of 61GB). | |
| # Apparently may increase Github Actions 'runner' to 59GB (instead of 31GB) . | |
| - name: Maximize build space | |
| if: ${{ github.event.inputs.runnerName == 'ubuntu-latest' || github.event.inputs.runnerName == 'ubuntu-22.04' }} | |
| uses: easimon/maximize-build-space@master | |
| with: | |
| #root-reserve-mb: 1625 | |
| root-reserve-mb: 6000 | |
| #temp-reserve-mb: 50 | |
| temp-reserve-mb: 6000 | |
| swap-size-mb: 2 | |
| remove-dotnet: 'true' | |
| remove-android: 'true' | |
| remove-haskell: 'true' | |
| remove-codeql: 'true' | |
| remove-docker-images: 'true' | |
| - uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 1 | |
| submodules: 'recursive' | |
| - name: _getMinimal_cloud | |
| shell: bash | |
| run: | | |
| ./ubiquitous_bash.sh _getMinimal_cloud | |
| timeout-minutes: 90 | |
| - name: _build_cloud_lts | |
| shell: bash | |
| run: | | |
| #export skimfast=${{ inputs.skimfast }} | |
| #echo skimfast $skimfast | |
| [[ "${{ github.event.inputs.forceKernel_lts }}" != "" ]] && [[ "${{ github.event.inputs.forceKernel_lts }}" != "latest" ]] && export forceKernel_lts="${{ github.event.inputs.forceKernel_lts }}" | |
| ./ubiquitous_bash.sh _build_cloud_prepare | |
| ./ubiquitous_bash.sh _build_cloud_lts | |
| timeout-minutes: 300 | |
| - name: _export_cloud_lts | |
| shell: bash | |
| run: | | |
| ./ubiquitous_bash.sh _export_cloud_lts | |
| timeout-minutes: 90 | |
| #- name: artifacts | |
| #uses: actions/upload-artifact@v3 | |
| #with: | |
| #name: build-lts | |
| #path: | | |
| #./_local/_export/linux-lts-amd64-debian.tar.gz | |
| - name: release! linux-lts-amd64-debian | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: build-${{ github.run_id }}-${{ github.run_attempt }} | |
| name: build | |
| files: | | |
| ./_local/_export/linux-lts-amd64-debian.tar.gz | |
| timeout-minutes: 45 | |
| build_mainline: | |
| if: ${{ github.event.inputs.forceKernel_mainline != 'none' }} | |
| runs-on: ${{ github.event.inputs.runnerName == '' && 'ubuntu-22.04' || github.event.inputs.runnerName }} | |
| steps: | |
| - name: forceKernel_mainline-${{ github.event.inputs.forceKernel_mainline }} ______________________________ | |
| shell: bash | |
| run: | | |
| true | |
| - name: RAND_SEED | |
| shell: bash | |
| run: | | |
| echo "$RAND_SEED" | tee /dev/urandom > /dev/null | |
| echo "$RAND_SEED" | tee /dev/random > /dev/null | |
| echo "$RAND_SEED" | sudo -n tee /dev/urandom > /dev/null | |
| echo "$RAND_SEED" | sudo -n tee /dev/random > /dev/null | |
| env: | |
| RAND_SEED: ${{ secrets.RAND_SEED }} | |
| - name: users | |
| shell: bash | |
| run: | | |
| sudo -u ubuntu -n bash -c 'sudo -n useradd runner --non-unique -u $UID -g $UID' || true | |
| sudo -u ubuntu -n bash -c 'sudo -n groupadd runner --non-unique -g $UID' || true | |
| sudo -u runner -n bash -c 'sudo -n echo $USER $UID' || true | |
| true | |
| # Apparently may increase buildJet 'runner' to 77GB (instead of 61GB). | |
| # Apparently may increase Github Actions 'runner' to 59GB (instead of 31GB) . | |
| - name: Maximize build space | |
| if: ${{ github.event.inputs.runnerName == 'ubuntu-latest' || github.event.inputs.runnerName == 'ubuntu-22.04' }} | |
| uses: easimon/maximize-build-space@master | |
| with: | |
| #root-reserve-mb: 1625 | |
| root-reserve-mb: 6000 | |
| #temp-reserve-mb: 50 | |
| temp-reserve-mb: 6000 | |
| swap-size-mb: 2 | |
| remove-dotnet: 'true' | |
| remove-android: 'true' | |
| remove-haskell: 'true' | |
| remove-codeql: 'true' | |
| remove-docker-images: 'true' | |
| - uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 1 | |
| submodules: 'recursive' | |
| - name: _getMinimal_cloud | |
| shell: bash | |
| run: | | |
| ./ubiquitous_bash.sh _getMinimal_cloud | |
| timeout-minutes: 90 | |
| - name: _build_cloud_mainline | |
| shell: bash | |
| run: | | |
| #export skimfast=${{ inputs.skimfast }} | |
| #echo skimfast $skimfast | |
| [[ "${{ github.event.inputs.forceKernel_mainline }}" != "" ]] && [[ "${{ github.event.inputs.forceKernel_mainline }}" != "latest" ]] && export forceKernel_mainline="${{ github.event.inputs.forceKernel_mainline }}" | |
| ./ubiquitous_bash.sh _build_cloud_prepare | |
| ./ubiquitous_bash.sh _build_cloud_mainline | |
| timeout-minutes: 300 | |
| - name: _export_cloud_mainline | |
| shell: bash | |
| run: | | |
| ./ubiquitous_bash.sh _export_cloud_mainline | |
| timeout-minutes: 90 | |
| # https://github.com/marketplace/actions/debugging-with-tmate | |
| # $RUNNER_WORKSPACE | |
| # rclone config --config="/rclone.conf" | |
| # sudo touch /continue | |
| # bash -i | |
| # source ~/.bashrc | |
| # Type 'q' at the 'Web shell' or use SSH . | |
| #- name: Setup tmate session | |
| #if: ${{ failure() }} | |
| #uses: mxschmitt/action-tmate@v3 | |
| ## ssh -i <path-to-key> <tmate-connection-string> | |
| #with: | |
| #limit-access-to-actor: true | |
| #timeout-minutes: 5 | |
| #- name: artifacts | |
| #uses: actions/upload-artifact@v3 | |
| #with: | |
| #name: build-mainline | |
| #path: | | |
| #./_local/_export/linux-mainline-amd64-debian.tar.gz | |
| - name: release! linux-mainline-amd64-debian | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: build-${{ github.run_id }}-${{ github.run_attempt }} | |
| name: build | |
| files: | | |
| ./_local/_export/linux-mainline-amd64-debian.tar.gz | |
| timeout-minutes: 45 | |
| build_mainline-server: | |
| if: ${{ github.event.inputs.forceKernel_mainline_server != 'none' }} | |
| runs-on: ${{ github.event.inputs.runnerName == '' && 'ubuntu-22.04' || github.event.inputs.runnerName }} | |
| steps: | |
| - name: forceKernel_mainline_server-${{ github.event.inputs.forceKernel_mainline_server }} ______________________________ | |
| shell: bash | |
| run: | | |
| true | |
| - name: RAND_SEED | |
| shell: bash | |
| run: | | |
| echo "$RAND_SEED" | tee /dev/urandom > /dev/null | |
| echo "$RAND_SEED" | tee /dev/random > /dev/null | |
| echo "$RAND_SEED" | sudo -n tee /dev/urandom > /dev/null | |
| echo "$RAND_SEED" | sudo -n tee /dev/random > /dev/null | |
| env: | |
| RAND_SEED: ${{ secrets.RAND_SEED }} | |
| - name: users | |
| shell: bash | |
| run: | | |
| sudo -u ubuntu -n bash -c 'sudo -n useradd runner --non-unique -u $UID -g $UID' || true | |
| sudo -u ubuntu -n bash -c 'sudo -n groupadd runner --non-unique -g $UID' || true | |
| sudo -u runner -n bash -c 'sudo -n echo $USER $UID' || true | |
| true | |
| # Apparently may increase buildJet 'runner' to 77GB (instead of 61GB). | |
| # Apparently may increase Github Actions 'runner' to 59GB (instead of 31GB) . | |
| - name: Maximize build space | |
| if: ${{ github.event.inputs.runnerName == 'ubuntu-latest' || github.event.inputs.runnerName == 'ubuntu-22.04' }} | |
| uses: easimon/maximize-build-space@master | |
| with: | |
| #root-reserve-mb: 1625 | |
| root-reserve-mb: 6000 | |
| #temp-reserve-mb: 50 | |
| temp-reserve-mb: 6000 | |
| swap-size-mb: 2 | |
| remove-dotnet: 'true' | |
| remove-android: 'true' | |
| remove-haskell: 'true' | |
| remove-codeql: 'true' | |
| remove-docker-images: 'true' | |
| - uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 1 | |
| submodules: 'recursive' | |
| - name: _getMinimal_cloud | |
| shell: bash | |
| run: | | |
| ./ubiquitous_bash.sh _getMinimal_cloud | |
| timeout-minutes: 90 | |
| - name: _build_cloud_mainline | |
| shell: bash | |
| run: | | |
| #export skimfast=${{ inputs.skimfast }} | |
| #echo skimfast $skimfast | |
| [[ "${{ github.event.inputs.forceKernel_mainline_server }}" != "" ]] && [[ "${{ github.event.inputs.forceKernel_mainline_server }}" != "latest" ]] && export forceKernel_mainline="${{ github.event.inputs.forceKernel_mainline_server }}" | |
| ./ubiquitous_bash.sh _build_cloud_prepare | |
| ./ubiquitous_bash.sh _build_cloud_mainline-server | |
| timeout-minutes: 300 | |
| - name: _export_cloud_mainline | |
| shell: bash | |
| run: | | |
| ./ubiquitous_bash.sh _export_cloud_mainline-server | |
| timeout-minutes: 90 | |
| # https://github.com/marketplace/actions/debugging-with-tmate | |
| # $RUNNER_WORKSPACE | |
| # rclone config --config="/rclone.conf" | |
| # sudo touch /continue | |
| # bash -i | |
| # source ~/.bashrc | |
| # Type 'q' at the 'Web shell' or use SSH . | |
| #- name: Setup tmate session | |
| #if: ${{ failure() }} | |
| #uses: mxschmitt/action-tmate@v3 | |
| ## ssh -i <path-to-key> <tmate-connection-string> | |
| #with: | |
| #limit-access-to-actor: true | |
| #timeout-minutes: 5 | |
| #- name: artifacts | |
| #uses: actions/upload-artifact@v3 | |
| #with: | |
| #name: build-mainline | |
| #path: | | |
| #./_local/_export/linux-mainline-amd64-debian.tar.gz | |
| - name: release! linux-mainline-server-amd64-debian | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: build-${{ github.run_id }}-${{ github.run_attempt }} | |
| name: build | |
| files: | | |
| ./_local/_export/linux-mainline-server-amd64-debian.tar.gz | |
| timeout-minutes: 45 | |
| build_lts-server: | |
| if: ${{ github.event.inputs.forceKernel_lts_server != 'none' }} | |
| runs-on: ${{ github.event.inputs.runnerName == '' && 'ubuntu-22.04' || github.event.inputs.runnerName }} | |
| steps: | |
| - name: forceKernel_lts_server-${{ github.event.inputs.forceKernel_lts_server }} ______________________________ | |
| shell: bash | |
| run: | | |
| true | |
| - name: RAND_SEED | |
| shell: bash | |
| run: | | |
| echo "$RAND_SEED" | tee /dev/urandom > /dev/null | |
| echo "$RAND_SEED" | tee /dev/random > /dev/null | |
| echo "$RAND_SEED" | sudo -n tee /dev/urandom > /dev/null | |
| echo "$RAND_SEED" | sudo -n tee /dev/random > /dev/null | |
| env: | |
| RAND_SEED: ${{ secrets.RAND_SEED }} | |
| - name: users | |
| shell: bash | |
| run: | | |
| sudo -u ubuntu -n bash -c 'sudo -n useradd runner --non-unique -u $UID -g $UID' || true | |
| sudo -u ubuntu -n bash -c 'sudo -n groupadd runner --non-unique -g $UID' || true | |
| sudo -u runner -n bash -c 'sudo -n echo $USER $UID' || true | |
| true | |
| # https://github.com/easimon/maximize-build-space | |
| - name: Maximize build space | |
| if: ${{ github.event.inputs.runnerName != 'ubuntu-latest-m' && github.event.inputs.runnerName != 'ubuntu-latest-l' && github.event.inputs.runnerName != 'ubuntu-latest-h' && github.event.inputs.runnerName != 'ubuntu-22.04-m' && github.event.inputs.runnerName != 'ubuntu-22.04-l' && github.event.inputs.runnerName != 'ubuntu-22.04-h' }} | |
| uses: easimon/maximize-build-space@master | |
| with: | |
| #root-reserve-mb: 1625 | |
| root-reserve-mb: 6000 | |
| #temp-reserve-mb: 50 | |
| temp-reserve-mb: 6000 | |
| swap-size-mb: 2 | |
| remove-dotnet: 'true' | |
| remove-android: 'true' | |
| remove-haskell: 'true' | |
| remove-codeql: 'true' | |
| remove-docker-images: 'true' | |
| - name: Maximize build space ! remove ONLY | |
| if: ${{ github.event.inputs.runnerName == 'ubuntu-latest-m' || github.event.inputs.runnerName == 'ubuntu-latest-l' || github.event.inputs.runnerName == 'ubuntu-latest-h' || github.event.inputs.runnerName == 'ubuntu-22.04-m' || github.event.inputs.runnerName == 'ubuntu-22.04-l' || github.event.inputs.runnerName == 'ubuntu-22.04-h' }} | |
| uses: AdityaGarg8/[email protected] | |
| with: | |
| remove-dotnet: 'true' | |
| remove-android: 'true' | |
| remove-haskell: 'true' | |
| remove-codeql: 'true' | |
| remove-docker-images: 'true' | |
| remove-large-packages: 'true' | |
| remove-cached-tools: 'true' | |
| remove-swapfile: 'true' | |
| verbose: 'false' | |
| - uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 1 | |
| submodules: 'recursive' | |
| # https://moebuta.org/posts/using-github-actions-to-build-linux-kernels/?utm_source=chatgpt.com | |
| # ATTRIBUTION-AI: ChatGPT 4o , o1 2025-01-18 . | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: build docker image | |
| run: | | |
| #docker build -t debian_bookworm-docker-image . | |
| docker build --build-arg HOST_UID=$(id -u) --build-arg HOST_GID=$(id -g) -t debian_bookworm-docker-image:latest . | |
| - name: _build_cloud_lts! docker | |
| if: ${{ github.event.inputs.container == 'docker' || github.event.inputs.container == '' }} | |
| run: | | |
| #docker run -it --name debian_bookworm-docker-container -d debian_bookworm-docker-image:latest | |
| #docker run -it --name debian_bookworm-docker-container -d debian_bookworm-docker-image:latest --rm "${dockerRunArgs[@]}" "$dockerImageObjectName" "${processedArgs[@]}" | |
| #docker run -it --name debian_bookworm-docker-container --rm debian_bookworm-docker-image:latest bash -c 'echo "Hello, World!" > /artifact.txt' | |
| #docker run -it --name debian_bookworm-docker-container --rm debian_bookworm-docker-image:latest bash -c 'echo $PWD | tee /artifact.txt' | |
| # | |
| #docker run -it --name debian_bookworm-docker-container -v "$PWD":/currentPWD:rw debian_bookworm-docker-image:latest bash -c 'echo $PWD | tee /artifact.txt' | |
| #docker cp debian_bookworm-docker-container:/artifact.txt ${{ github.workspace }} | |
| #docker rm debian_bookworm-docker-container | |
| #cat ${{ github.workspace }}/artifact.txt | |
| #cat ./artifact.txt | |
| # | |
| docker run --name debian_bookworm-docker-container --user "$(id -u):$(id -g)" -v "$PWD":/currentPWD:rw debian_bookworm-docker-image:latest bash -c './ubiquitous_bash.sh _build_cloud_prepare' | |
| docker run --name debian_bookworm-docker-container --user "$(id -u):$(id -g)" -v "$PWD":/currentPWD:rw debian_bookworm-docker-image:latest bash -c './ubiquitous_bash.sh _build_cloud_lts-server' | |
| docker rm debian_bookworm-docker-container | |
| false | |
| - name: _getMinimal_cloud | |
| #if: ${{ github.event.inputs.container == 'none' }} | |
| shell: bash | |
| run: | | |
| ./ubiquitous_bash.sh _getMinimal_cloud | |
| timeout-minutes: 90 | |
| - name: _build_cloud_lts | |
| if: ${{ github.event.inputs.container == 'none' }} | |
| shell: bash | |
| run: | | |
| #export skimfast=${{ inputs.skimfast }} | |
| #echo skimfast $skimfast | |
| [[ "${{ github.event.inputs.forceKernel_lts_server }}" != "" ]] && [[ "${{ github.event.inputs.forceKernel_lts_server }}" != "latest" ]] && export forceKernel_lts="${{ github.event.inputs.forceKernel_lts_server }}" | |
| ./ubiquitous_bash.sh _build_cloud_prepare | |
| ./ubiquitous_bash.sh _build_cloud_lts-server | |
| timeout-minutes: 300 | |
| - name: _export_cloud_lts | |
| shell: bash | |
| run: | | |
| ./ubiquitous_bash.sh _export_cloud_lts-server | |
| timeout-minutes: 90 | |
| # https://github.com/marketplace/actions/debugging-with-tmate | |
| # $RUNNER_WORKSPACE | |
| # rclone config --config="/rclone.conf" | |
| # sudo touch /continue | |
| # bash -i | |
| # source ~/.bashrc | |
| # Type 'q' at the 'Web shell' or use SSH . | |
| #- name: Setup tmate session | |
| #if: ${{ failure() }} | |
| #uses: mxschmitt/action-tmate@v3 | |
| ## ssh -i <path-to-key> <tmate-connection-string> | |
| #with: | |
| #limit-access-to-actor: true | |
| #timeout-minutes: 5 | |
| #- name: artifacts | |
| #uses: actions/upload-artifact@v3 | |
| #with: | |
| #name: build-lts | |
| #path: | | |
| #./_local/_export/linux-lts-amd64-debian.tar.gz | |
| - name: release! linux-lts-server-amd64-debian | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: build-${{ github.run_id }}-${{ github.run_attempt }} | |
| name: build | |
| files: | | |
| ./_local/_export/linux-lts-server-amd64-debian.tar.gz | |
| timeout-minutes: 45 | |