diff --git a/.github/actions/setup-build/action.yml b/.github/actions/setup-build/action.yml new file mode 100644 index 000000000..0a4676e9a --- /dev/null +++ b/.github/actions/setup-build/action.yml @@ -0,0 +1,87 @@ +name: Setup Build Environment +description: Common build environment setup steps + +inputs: + nodejs-version: + description: Node.js version + required: true + use-tmpfs: + description: Mount tmpfs (for fast runners) + required: false + default: "false" + setup-python: + description: Set up Python + required: false + default: "false" + setup-docker: + description: Set up Docker QEMU and Buildx + required: false + default: "true" + setup-sccache: + description: Configure sccache for GitHub Actions + required: false + default: "true" + free-space: + description: Remove unnecessary packages to free disk space + required: false + default: "true" + +runs: + using: composite + steps: + - name: Free disk space + if: inputs.free-space == 'true' + shell: bash + run: | + sudo apt-get remove --purge -y azure-cli || true + sudo apt-get remove --purge -y firefox || true + sudo apt-get remove --purge -y ghc-* || true + sudo apt-get remove --purge -y google-cloud-sdk || true + sudo apt-get remove --purge -y google-chrome-stable || true + sudo apt-get remove --purge -y powershell || true + sudo apt-get remove --purge -y php* || true + sudo apt-get remove --purge -y ruby* || true + sudo apt-get remove --purge -y mono-* || true + sudo apt-get autoremove -y + sudo apt-get clean + sudo rm -rf /usr/lib/jvm + sudo rm -rf /usr/local/.ghcup + sudo rm -rf /usr/local/lib/android + sudo rm -rf /usr/share/dotnet + sudo rm -rf /usr/share/swift + sudo rm -rf "$AGENT_TOOLSDIRECTORY" + + - name: Mount tmpfs + if: inputs.use-tmpfs == 'true' + shell: bash + run: sudo mount -t tmpfs tmpfs . + + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Set up Python + if: inputs.setup-python == 'true' + uses: actions/setup-python@v5 + with: + python-version: "3.x" + + - uses: actions/setup-node@v4 + with: + node-version: ${{ inputs.nodejs-version }} + + - name: Set up Docker QEMU + if: inputs.setup-docker == 'true' + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + if: inputs.setup-docker == 'true' + uses: docker/setup-buildx-action@v3 + + - name: Configure sccache + if: inputs.setup-sccache == 'true' + uses: actions/github-script@v7 + with: + script: | + core.exportVariable('ACTIONS_RESULTS_URL', process.env.ACTIONS_RESULTS_URL || ''); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); diff --git a/.github/workflows/start-cli.yaml b/.github/workflows/start-cli.yaml index 941614b11..e0d2a2752 100644 --- a/.github/workflows/start-cli.yaml +++ b/.github/workflows/start-cli.yaml @@ -38,7 +38,7 @@ on: - next/* concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.head.sha || github.sha }} + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} cancel-in-progress: true env: @@ -48,6 +48,7 @@ env: jobs: compile: name: Build Debian Package + if: github.event.pull_request.draft != true strategy: fail-fast: true matrix: @@ -64,50 +65,10 @@ jobs: }} runs-on: ${{ fromJson('["ubuntu-latest", "buildjet-32vcpu-ubuntu-2204"]')[github.event.inputs.runner == 'fast'] }} steps: - - name: Cleaning up unnecessary files - run: | - sudo apt-get remove --purge -y mono-* \ - ghc* cabal-install* \ - dotnet* \ - php* \ - ruby* \ - mysql-* \ - postgresql-* \ - azure-cli \ - powershell \ - google-cloud-sdk \ - msodbcsql* mssql-tools* \ - imagemagick* \ - libgl1-mesa-dri \ - google-chrome-stable \ - firefox - sudo apt-get autoremove -y - sudo apt-get clean - - - run: | - sudo mount -t tmpfs tmpfs . - if: ${{ github.event.inputs.runner == 'fast' }} - - - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-build with: - submodules: recursive - - - uses: actions/setup-node@v4 - with: - node-version: ${{ env.NODEJS_VERSION }} - - - name: Set up docker QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Configure sccache - uses: actions/github-script@v7 - with: - script: | - core.exportVariable('ACTIONS_RESULTS_URL', process.env.ACTIONS_RESULTS_URL || ''); - core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + nodejs-version: ${{ env.NODEJS_VERSION }} + use-tmpfs: ${{ github.event.inputs.runner == 'fast' }} - name: Make run: TARGET=${{ matrix.triple }} make cli diff --git a/.github/workflows/start-registry.yaml b/.github/workflows/start-registry.yaml index 3e042c16d..51f0be9c1 100644 --- a/.github/workflows/start-registry.yaml +++ b/.github/workflows/start-registry.yaml @@ -36,7 +36,7 @@ on: - next/* concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.head.sha || github.sha }} + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} cancel-in-progress: true env: @@ -46,6 +46,7 @@ env: jobs: compile: name: Build Debian Package + if: github.event.pull_request.draft != true strategy: fail-fast: true matrix: @@ -60,50 +61,10 @@ jobs: }} runs-on: ${{ fromJson('["ubuntu-latest", "buildjet-32vcpu-ubuntu-2204"]')[github.event.inputs.runner == 'fast'] }} steps: - - name: Cleaning up unnecessary files - run: | - sudo apt-get remove --purge -y mono-* \ - ghc* cabal-install* \ - dotnet* \ - php* \ - ruby* \ - mysql-* \ - postgresql-* \ - azure-cli \ - powershell \ - google-cloud-sdk \ - msodbcsql* mssql-tools* \ - imagemagick* \ - libgl1-mesa-dri \ - google-chrome-stable \ - firefox - sudo apt-get autoremove -y - sudo apt-get clean - - - run: | - sudo mount -t tmpfs tmpfs . - if: ${{ github.event.inputs.runner == 'fast' }} - - - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-build with: - submodules: recursive - - - uses: actions/setup-node@v4 - with: - node-version: ${{ env.NODEJS_VERSION }} - - - name: Set up docker QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Configure sccache - uses: actions/github-script@v7 - with: - script: | - core.exportVariable('ACTIONS_RESULTS_URL', process.env.ACTIONS_RESULTS_URL || ''); - core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + nodejs-version: ${{ env.NODEJS_VERSION }} + use-tmpfs: ${{ github.event.inputs.runner == 'fast' }} - name: Make run: make registry-deb diff --git a/.github/workflows/start-tunnel.yaml b/.github/workflows/start-tunnel.yaml index 5bdc71411..28be88094 100644 --- a/.github/workflows/start-tunnel.yaml +++ b/.github/workflows/start-tunnel.yaml @@ -36,7 +36,7 @@ on: - next/* concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.head.sha || github.sha }} + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} cancel-in-progress: true env: @@ -46,6 +46,7 @@ env: jobs: compile: name: Build Debian Package + if: github.event.pull_request.draft != true strategy: fail-fast: true matrix: @@ -60,50 +61,10 @@ jobs: }} runs-on: ${{ fromJson('["ubuntu-latest", "buildjet-32vcpu-ubuntu-2204"]')[github.event.inputs.runner == 'fast'] }} steps: - - name: Cleaning up unnecessary files - run: | - sudo apt-get remove --purge -y mono-* \ - ghc* cabal-install* \ - dotnet* \ - php* \ - ruby* \ - mysql-* \ - postgresql-* \ - azure-cli \ - powershell \ - google-cloud-sdk \ - msodbcsql* mssql-tools* \ - imagemagick* \ - libgl1-mesa-dri \ - google-chrome-stable \ - firefox - sudo apt-get autoremove -y - sudo apt-get clean - - - run: | - sudo mount -t tmpfs tmpfs . - if: ${{ github.event.inputs.runner == 'fast' }} - - - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-build with: - submodules: recursive - - - uses: actions/setup-node@v4 - with: - node-version: ${{ env.NODEJS_VERSION }} - - - name: Set up docker QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Configure sccache - uses: actions/github-script@v7 - with: - script: | - core.exportVariable('ACTIONS_RESULTS_URL', process.env.ACTIONS_RESULTS_URL || ''); - core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + nodejs-version: ${{ env.NODEJS_VERSION }} + use-tmpfs: ${{ github.event.inputs.runner == 'fast' }} - name: Make run: make tunnel-deb diff --git a/.github/workflows/startos-iso.yaml b/.github/workflows/startos-iso.yaml index d2843344e..c4b336348 100644 --- a/.github/workflows/startos-iso.yaml +++ b/.github/workflows/startos-iso.yaml @@ -46,7 +46,7 @@ on: - next/* concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.head.sha || github.sha }} + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} cancel-in-progress: true env: @@ -56,6 +56,7 @@ env: jobs: compile: name: Compile Base Binaries + if: github.event.pull_request.draft != true strategy: fail-fast: true matrix: @@ -90,54 +91,11 @@ jobs: )[github.event.inputs.runner == 'fast'] }} steps: - - name: Cleaning up unnecessary files - run: | - sudo apt-get remove --purge -y azure-cli || true - sudo apt-get remove --purge -y firefox || true - sudo apt-get remove --purge -y ghc-* || true - sudo apt-get remove --purge -y google-cloud-sdk || true - sudo apt-get remove --purge -y google-chrome-stable || true - sudo apt-get remove --purge -y powershell || true - sudo apt-get remove --purge -y php* || true - sudo apt-get remove --purge -y ruby* || true - sudo apt-get remove --purge -y mono-* || true - sudo apt-get autoremove -y - sudo apt-get clean - sudo rm -rf /usr/lib/jvm # All JDKs - sudo rm -rf /usr/local/.ghcup # Haskell toolchain - sudo rm -rf /usr/local/lib/android # Android SDK/NDK, emulator - sudo rm -rf /usr/share/dotnet # .NET SDKs - sudo rm -rf /usr/share/swift # Swift toolchain (if present) - sudo rm -rf "$AGENT_TOOLSDIRECTORY" # Pre-cached tool cache (Go, Node, etc.) - - run: | - sudo mount -t tmpfs tmpfs . - if: ${{ github.event.inputs.runner == 'fast' }} - - - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-build with: - submodules: recursive - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.x" - - - uses: actions/setup-node@v4 - with: - node-version: ${{ env.NODEJS_VERSION }} - - - name: Set up docker QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Configure sccache - uses: actions/github-script@v7 - with: - script: | - core.exportVariable('ACTIONS_RESULTS_URL', process.env.ACTIONS_RESULTS_URL || ''); - core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + nodejs-version: ${{ env.NODEJS_VERSION }} + use-tmpfs: ${{ github.event.inputs.runner == 'fast' }} + setup-python: "true" - name: Make run: make ARCH=${{ matrix.arch }} compiled-${{ matrix.arch }}.tar diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index f1c793127..e6fe370b7 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -11,7 +11,7 @@ on: - next/* concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.head.sha || github.sha }} + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} cancel-in-progress: true env: @@ -21,15 +21,15 @@ env: jobs: test: name: Run Automated Tests + if: github.event.pull_request.draft != true runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-build with: - submodules: recursive - - - uses: actions/setup-node@v4 - with: - node-version: ${{ env.NODEJS_VERSION }} + nodejs-version: ${{ env.NODEJS_VERSION }} + free-space: "false" + setup-docker: "false" + setup-sccache: "false" - name: Build And Run Tests run: make test diff --git a/build/upload-ota.sh b/build/upload-ota.sh index 3165328c4..74e1b42aa 100755 --- a/build/upload-ota.sh +++ b/build/upload-ota.sh @@ -85,9 +85,9 @@ cat << EOF # ISO Downloads - [x86_64/AMD64](https://startos-images.nyc3.cdn.digitaloceanspaces.com/v$VERSION/$(ls *_x86_64-nonfree.iso)) -- [x86_64/AMD64 (Slim/FOSS-Only)](https://startos-images.nyc3.cdn.digitaloceanspaces.com/v$VERSION/$(ls *_x86_64.iso) "Without proprietary software or drivers") +- [x86_64/AMD64-slim (FOSS-only)](https://startos-images.nyc3.cdn.digitaloceanspaces.com/v$VERSION/$(ls *_x86_64.iso) "Without proprietary software or drivers") - [aarch64/ARM64](https://startos-images.nyc3.cdn.digitaloceanspaces.com/v$VERSION/$(ls *_aarch64-nonfree.iso)) -- [aarch64/ARM64 (Slim/FOSS-Only)](https://startos-images.nyc3.cdn.digitaloceanspaces.com/v$VERSION/$(ls *_aarch64.iso) "Without proprietary software or drivers") +- [aarch64/ARM64-slim (FOSS-Only)](https://startos-images.nyc3.cdn.digitaloceanspaces.com/v$VERSION/$(ls *_aarch64.iso) "Without proprietary software or drivers") - [RISCV64 (RVA23)](https://startos-images.nyc3.cdn.digitaloceanspaces.com/v$VERSION/$(ls *_riscv64.iso)) EOF