Build Cross-Platform Chromium 149 #5
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 Cross-Platform Chromium images | |
| run-name: Build Cross-Platform Chromium ${{ inputs.chromium_major || '149' }} | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| chromium_major: | |
| description: Chromium major version (for example, 149) | |
| required: true | |
| type: string | |
| push: | |
| branches: | |
| - users/shadowusr/TESTPLANE-1100 | |
| permissions: | |
| contents: read | |
| packages: write | |
| concurrency: | |
| group: chromium-${{ inputs.chromium_major || '149' }} | |
| cancel-in-progress: false | |
| env: | |
| IMAGE: ghcr.io/gemini-testing/browsers/chromium | |
| jobs: | |
| build: | |
| name: Build linux/${{ matrix.architecture }} | |
| runs-on: ${{ matrix.runner }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - architecture: amd64 | |
| runner: ubuntu-24.04 | |
| - architecture: arm64 | |
| runner: ubuntu-24.04-arm | |
| env: | |
| ARCHITECTURE: ${{ matrix.architecture }} | |
| CHROMIUM_MAJOR: ${{ inputs.chromium_major || '149' }} | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v7 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Go | |
| uses: actions/setup-go@v7 | |
| with: | |
| go-version-file: go.mod | |
| cache-dependency-path: go.sum | |
| - name: Validate Chromium version | |
| run: | | |
| if [[ ! "$CHROMIUM_MAJOR" =~ ^[0-9]+$ ]]; then | |
| echo "Chromium version must be a major version such as 149" >&2 | |
| exit 1 | |
| fi | |
| - name: Build image orchestrator | |
| run: | | |
| go install github.com/markbates/pkger/cmd/pkger@v0.17.1 | |
| export PATH="$(go env GOPATH)/bin:$PATH" | |
| go generate . | |
| go build -o images . | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push native image | |
| run: | | |
| tag="$IMAGE:${CHROMIUM_MAJOR}.0-${ARCHITECTURE}" | |
| ./images chromium \ | |
| --debian \ | |
| --architecture "$ARCHITECTURE" \ | |
| --browser "$CHROMIUM_MAJOR" \ | |
| --tag "$tag" \ | |
| --push | |
| manifest: | |
| name: Publish multi-platform image | |
| needs: build | |
| runs-on: ubuntu-24.04 | |
| env: | |
| CHROMIUM_MAJOR: ${{ inputs.chromium_major || '149' }} | |
| steps: | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Publish multi-platform image | |
| run: | | |
| tag="$IMAGE:${CHROMIUM_MAJOR}.0" | |
| docker buildx imagetools create \ | |
| --tag "$tag" \ | |
| "${tag}-amd64" \ | |
| "${tag}-arm64" | |
| - name: Inspect multi-platform image | |
| run: | | |
| docker buildx imagetools inspect "$IMAGE:${CHROMIUM_MAJOR}.0" |