diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e39a24b77..1ec016664 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,9 +3,33 @@ name: Build and Release on: push jobs: + + cache: + name: Cache + runs-on: ubuntu-22.04 + steps: + - name: Cache permissions + run: | + sudo chown $(id -un) /var/cache/apt/archives + - name: Cache packages + uses: actions/cache@v4 + with: + path: /var/cache/apt/archives/*.deb + key: apt-cache-${{ github.run_id }}-${{ github.run_attempt }} + restore-keys: | + apt-cache- + - name: Download packages + run: | + sudo apt update + sudo apt install -y -d -o Acquire::Retries=50 \ + mtools syslinux isolinux \ + libc6-dev-i386 valgrind \ + gcc-arm-none-eabi gcc-aarch64-linux-gnu + build: name: Build on ${{ matrix.arch }} runs-on: ubuntu-22.04 + needs: cache strategy: matrix: include: @@ -28,8 +52,19 @@ jobs: with: fetch-depth: 0 + - name: Cache permissions + run: | + sudo chown $(id -un) /var/cache/apt/archives + + - name: Cache packages + uses: actions/cache/restore@v4 + with: + path: /var/cache/apt/archives/*.deb + key: apt-cache-${{ github.run_id }}-${{ github.run_attempt }} + - name: Install packages run: | + sudo dpkg --add-architecture i386 sudo apt update sudo apt install -y -o Acquire::Retries=50 ${{ matrix.packages }} @@ -80,15 +115,3 @@ jobs: - name: Download all artifacts uses: actions/download-artifact@v2 - # The following step assumes artifacts are structured in a way that the release job can easily access and upload them. - # You may need to adjust the script based on your actual artifact structure and names. - - name: Upload Artifacts to Release - run: | - for artifact in $(ls -1); do - if [[ -d "$artifact" ]]; then - echo "Uploading $artifact..." - gh release upload ${{ github.ref_name }} "${artifact}/*" --clobber -R ${{ github.repository }} - fi - done - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file