mirror of
https://github.com/gmeligio/flutter-docker-image.git
synced 2026-05-24 12:30:34 +00:00
008cce50a1
- Extends the manifest-first discipline (already used for Flutter/Android) to the Windows toolchain. `config/version.json` now carries `windows.git`, `windows.vsBuildTools.cmakeProject`, `windows.vsBuildTools.windows11Sdk.build`, and `windows.vsBuildTools.vcTools`; `config/schema.cue` validates them via new `#SemverQuad` and `#WindowsToolchain` definitions. --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: verified-commit[bot] <180343340+verified-commit[bot]@users.noreply.github.com>
71 lines
2.6 KiB
YAML
71 lines
2.6 KiB
YAML
on:
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
# Read-only permissions by default
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
test_windows:
|
|
runs-on: windows-2025
|
|
env:
|
|
IMAGE_REPOSITORY_NAME: flutter-windows
|
|
VERSION_MANIFEST: config/version.json
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
|
|
|
- name: Clean runner disk
|
|
uses: ./.github/actions/clean-runner-disk
|
|
|
|
# Secrets are not available to PRs from forks. The Windows base image
|
|
# comes from mcr.microsoft.com, so Docker Hub auth is not strictly
|
|
# required to build/test the image.
|
|
- name: Login to Docker Hub
|
|
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
|
|
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
|
|
with:
|
|
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
|
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
|
|
|
- name: Read environment variables from the version manifest
|
|
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
|
env:
|
|
GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }}
|
|
IMAGE_REPOSITORY_NAME: ${{ env.IMAGE_REPOSITORY_NAME }}
|
|
VERSION_MANIFEST: ${{ env.VERSION_MANIFEST }}
|
|
with:
|
|
script: |
|
|
const script = require('./script/setEnvironmentVariables.js')
|
|
return await script({ core })
|
|
|
|
- name: Load image metadata
|
|
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5.7.0
|
|
id: metadata
|
|
with:
|
|
images: |
|
|
${{ env.IMAGE_REPOSITORY_PATH }}
|
|
tags: |
|
|
type=raw,value=${{ env.FLUTTER_VERSION }}
|
|
|
|
# Docker Buildx is not supported for Windows containers
|
|
# so we'll use direct docker build commands
|
|
- name: Test image and push to local Docker daemon
|
|
shell: powershell
|
|
run: |
|
|
docker build . -f windows.Dockerfile `
|
|
--build-arg flutter_version=${{ env.FLUTTER_VERSION }} `
|
|
--build-arg git_version=${{ env.GIT_VERSION }} `
|
|
--build-arg vs_cmake_version=${{ env.VS_CMAKE_VERSION }} `
|
|
--build-arg vs_win11sdk_build=${{ env.VS_WIN11SDK_BUILD }} `
|
|
--build-arg vs_vctools_version=${{ env.VS_VCTOOLS_VERSION }} `
|
|
-t ${{ fromJson(steps.metadata.outputs.json).tags[0] }} --target test
|
|
|
|
docker run --rm ${{ fromJson(steps.metadata.outputs.json).tags[0] }}
|
|
|