Fix git describe abbrev length for reproducibility #123
Workflow file for this run
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: Docker - build baochip firmware | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - docker-* | |
| pull_request: | |
| branches: | |
| - main | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_PREFIX: ${{ github.repository }} | |
| RUST_IMAGE_SHA256: 5fdb652f0f6e83c24ebbba6d9c51a9836c6f3c4fa12dc3040e6327c6eb355769 | |
| RUST_VERSION: 1.93.0 | |
| jobs: | |
| docker-build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| task: | |
| - name: dabao | |
| os: xous | |
| - name: baosec | |
| os: xous | |
| - name: bao1x-boot0 | |
| os: none | |
| - name: bao1x-boot1 | |
| os: none | |
| - name: bao1x-alt-boot1 | |
| os: none | |
| - name: bao1x-baremetal-dabao | |
| os: none | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Fetch all tags | |
| run: git fetch --prune --unshallow --tags | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| with: | |
| driver-opts: | | |
| network=host | |
| image=moby/buildkit:latest | |
| - name: Configure Docker daemon for performance | |
| run: | | |
| echo '{"max-concurrent-downloads": 10, "max-concurrent-uploads": 10}' | sudo tee /etc/docker/daemon.json | |
| sudo systemctl restart docker | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract metadata | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_PREFIX }}/${{ matrix.task.name }} | |
| tags: | | |
| type=ref,event=branch | |
| type=ref,event=pr | |
| type=sha,prefix=sha- | |
| type=raw,value=latest,enable={{is_default_branch}} | |
| - name: Build ${{ matrix.task.name }} firmware | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| build-args: | | |
| RUST_VERSION=${{ env.RUST_VERSION }} | |
| IMG_SHA256=${{ env.RUST_IMAGE_SHA256 }} | |
| task=${{ matrix.task.name }} | |
| os=${{ matrix.task.os }} | |
| push: ${{ github.event_name != 'pull_request' }} | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: | | |
| type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_PREFIX }}/cache:${{ matrix.task.name }} | |
| type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_PREFIX }}/cache:base | |
| cache-to: ${{ github.event_name != 'pull_request' && format('type=registry,ref={0}/{1}/cache:{2},mode=max', env.REGISTRY, env.IMAGE_PREFIX, matrix.task.name) || '' }} | |
| outputs: type=local,dest=./output | |
| provenance: false | |
| sbom: false | |
| - name: Upload ${{ matrix.task.name }} artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.task.name }} | |
| path: | | |
| ./output/*.uf2 | |
| ./output/*.img | |
| ./output/*.bin | |
| retention-days: 90 |