network: persist random eth0 MAC across boots #938
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 | |
| on: | |
| push: | |
| branches: | |
| - develop | |
| paths-ignore: | |
| - '*.md' | |
| - .github/workflows/*.yaml | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| custom-firmware-build: | |
| runs-on: ubuntu-24.04-arm | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Record start time | |
| run: echo "JOB_START=$(date +%s)" >> $GITHUB_ENV | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| submodules: recursive | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build Docker image with cache | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: .github/dev | |
| load: true | |
| tags: snapmaker-u1-dev:latest | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| build-args: BUILDKIT_INLINE_CACHE=1 | |
| - name: Load values vars.mk | |
| run: cat vars.mk >> "$GITHUB_ENV" | |
| - name: Restore Firmwares Cache | |
| id: cache-firmwares | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: firmware/ | |
| key: firmwares-${{ runner.os }}-${{ runner.arch }}-${{ env.FIRMWARE_VERSION }} | |
| - name: Restore Kernel Cache | |
| id: cache-kernel | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: tmp/kernel/ | |
| key: kernels-${{ runner.os }}-${{ runner.arch }}-${{ env.KERNEL_SHA }} | |
| - name: Restore ccache | |
| id: cache-ccache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: tmp/ccache/ | |
| key: ccache-${{ runner.os }}-${{ runner.arch }}-${{ github.head_ref || github.ref_name }} | |
| restore-keys: | | |
| ccache-${{ runner.os }}-${{ runner.arch }}- | |
| - name: Restore downloads cache | |
| id: cache-downloads | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: | | |
| tmp/cache/**/.git | |
| tmp/cache/**/*.zip | |
| tmp/cache/**/*.gz | |
| tmp/cache/**/*.xz | |
| key: downloads-${{ runner.os }}-${{ runner.arch }}-${{ github.head_ref || github.ref_name }} | |
| restore-keys: | | |
| downloads-${{ runner.os }}-${{ runner.arch }}- | |
| - name: Set GIT_VERSION (for branch) | |
| shell: bash | |
| if: github.event_name == 'push' | |
| run: | | |
| nextVer=$(./scripts/next_version.sh paxx12 test-branch-${{ github.ref_name }}) | |
| echo "GIT_VERSION=${nextVer//v/}" | tee -a $GITHUB_ENV | |
| - name: Set GIT_VERSION (for Pull Request) | |
| shell: bash | |
| if: github.event_name == 'pull_request' | |
| run: | | |
| nextVer=$(./scripts/next_version.sh paxx12 test-pr-${{ github.event.pull_request.number }}) | |
| echo "GIT_VERSION=${nextVer//v/}" | tee -a $GITHUB_ENV | |
| - name: Download firmware | |
| run: ./dev.sh make firmware | |
| - name: Build with Extended Fluidd firmware | |
| run: ./dev.sh make build PROFILE=extended OUTPUT_FILE=U1_extended_${{ env.GIT_VERSION }}_upgrade.bin | |
| - name: Build DEVEL version of Extended Fluidd firmware | |
| run: ./dev.sh make build PROFILE=extended-devel OUTPUT_FILE=U1_extended_${{ env.GIT_VERSION }}_devel.bin | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: extended-build | |
| path: U1_extended_*_upgrade.bin | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: extended-devel-build | |
| path: U1_extended_*_devel.bin | |
| - name: Save PR info | |
| if: github.event_name == 'pull_request' | |
| run: | | |
| mkdir -p pr-info | |
| echo "${{ github.event.pull_request.number }}" > pr-info/number | |
| echo "${{ github.event.pull_request.head.sha }}" > pr-info/head_sha | |
| echo "${{ github.sha }}" > pr-info/merge_sha | |
| echo "${{ github.base_ref }}" > pr-info/base_ref | |
| echo "${{ env.GIT_VERSION }}" > pr-info/version | |
| echo "${{ env.JOB_START }}" > pr-info/job_start | |
| echo "$(date +%s)" > pr-info/job_end | |
| echo extended-build >> pr-info/artifacts | |
| echo extended-devel-build >> pr-info/artifacts | |
| - name: Upload PR info | |
| if: github.event_name == 'pull_request' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: pr-info | |
| path: pr-info/ | |
| - name: Save Firmwares Cache | |
| if: steps.cache-firmwares.outputs.cache-hit != 'true' | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: firmware/ | |
| key: firmwares-${{ runner.os }}-${{ runner.arch }}-${{ env.FIRMWARE_VERSION }} | |
| - name: Save Kernel Cache | |
| if: steps.cache-kernel.outputs.cache-hit != 'true' | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: tmp/kernel/ | |
| key: kernels-${{ runner.os }}-${{ runner.arch }}-${{ env.KERNEL_SHA }} | |
| - name: Save ccache | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: tmp/ccache/ | |
| key: ccache-${{ runner.os }}-${{ runner.arch }}-${{ github.head_ref || github.ref_name }} | |
| - name: Save downloads cache | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: | | |
| tmp/cache/**/.git | |
| tmp/cache/**/*.zip | |
| tmp/cache/**/*.gz | |
| tmp/cache/**/*.xz | |
| key: downloads-${{ runner.os }}-${{ runner.arch }}-${{ github.head_ref || github.ref_name }} |