fix: ZapLink size limit, signed checksum updater verification, execut… #12
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 zigcc Docker image | |
| on: | |
| push: | |
| paths: | |
| - 'scripts/zigcc/**' | |
| - '.github/workflows/zigcc-build.yml' | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version tag (e.g., 1.0.1)' | |
| required: true | |
| type: string | |
| workflow_call: | |
| outputs: | |
| version: | |
| description: 'The zigcc image version that was built or verified' | |
| value: ${{ jobs.build.outputs.version }} | |
| permissions: | |
| contents: read | |
| packages: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| version: ${{ steps.version.outputs.version }} | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Set version | |
| id: version | |
| run: | | |
| if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | |
| VERSION="${{ github.event.inputs.version }}" | |
| else | |
| VERSION=$(cat scripts/zigcc/VERSION) | |
| fi | |
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | |
| echo "Building zigcc version: $VERSION" | |
| - name: Set lowercase repository owner | |
| run: | | |
| echo "OWNER_LC=${OWNER,,}" >> "$GITHUB_ENV" | |
| env: | |
| OWNER: ${{ github.repository_owner }} | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Check if version exists | |
| id: check | |
| run: | | |
| if docker manifest inspect ghcr.io/${{ env.OWNER_LC }}/zigcc:${{ steps.version.outputs.version }} > /dev/null 2>&1; then | |
| echo "exists=true" >> "$GITHUB_OUTPUT" | |
| echo "Version ${{ steps.version.outputs.version }} already exists in registry" | |
| else | |
| echo "exists=false" >> "$GITHUB_OUTPUT" | |
| echo "Version ${{ steps.version.outputs.version }} will be built" | |
| fi | |
| - name: Set up Docker Buildx | |
| if: steps.check.outputs.exists != 'true' | |
| uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3 | |
| - name: Build and push | |
| if: steps.check.outputs.exists != 'true' | |
| uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6 | |
| with: | |
| context: ./scripts/zigcc | |
| push: true | |
| tags: | | |
| ghcr.io/${{ env.OWNER_LC }}/zigcc:${{ steps.version.outputs.version }} | |
| ghcr.io/${{ env.OWNER_LC }}/zigcc:latest | |
| build-args: | | |
| UID=1001 | |
| GID=1001 | |
| cache-from: type=gha,scope=zigcc-build | |
| cache-to: type=gha,mode=max,scope=zigcc-build |