name: Build image on: push: branches: - main tags: - v* workflow_dispatch: jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 # Check cache - name: Cache buildroot id: cache uses: actions/cache@v3 with: path: .buildroot key: ${{ runner.os }}-${{ hashFiles('files/configs/arpl_defconfig') }} # Install dependencies - name: Install dependencies run: | sudo apt-get update sudo apt-get install -y libelf-dev qemu-utils # Prepare buildroot for first make (for cache) - name: Prepare buildroot if: steps.cache.outputs.cache-hit != 'true' run: | git clone --single-branch -b 2022.02 https://github.com/buildroot/buildroot.git .buildroot # Copy files echo "Copying files" cp -Ru files/* .buildroot cd .buildroot echo "Generating default config" make BR2_EXTERNAL=../external arpl_defconfig echo "First make" make BR2_EXTERNAL=../external # Build incremental from cache - name: Build image id: build run: | VERSION=`> sha256sum # Upload artifact - name: Upload uses: actions/upload-artifact@v3 with: name: Images path: | arpl.img arpl*.vmdk retention-days: 5 # Publish a release if is a tag - name: Release uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') with: files: | arpl-${{ steps.build.outputs.VERSION }}.img.zip arpl-${{ steps.build.outputs.VERSION }}.vmdk.zip .buildroot/output/images/bzImage .buildroot/output/images/rootfs.cpio.xz sha256sum