From edf0d06360de7e4689b4738edc569bdf70d6ba99 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Fri, 21 Mar 2025 19:42:28 +0100 Subject: [PATCH 1/2] winflexbison: add package builder --- winflexbison/package-windows.ps1 | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 winflexbison/package-windows.ps1 diff --git a/winflexbison/package-windows.ps1 b/winflexbison/package-windows.ps1 new file mode 100644 index 0000000..fd0ecc9 --- /dev/null +++ b/winflexbison/package-windows.ps1 @@ -0,0 +1,31 @@ +$erroractionpreference = "stop" + +# Keep in sync with the common script. +$git_url = 'https://github.com/lexxmark/winflexbison' +$git_commit = '300f48ba3e598e7a6600d724b58541fbcc3c2fa6' # PR #91 merged +$version = '2.5.25.g300f48b-concurrent-builds' + +git clone "$git_url" winflexbison/src +git -C winflexbison/src -c advice.detachedHead=false checkout "$git_commit" + +if ($env:VSCMD_ARG_TGT_ARCH -eq "x64") { + $arch = "x86_64"; +} elseif ($env:VSCMD_ARG_TGT_ARCH -eq "arm64") { + $arch = "arm64"; +} else { + Write-Host "VSCMD_ARG_TGT_ARCH env var not recognized. Run this from a Visual Studio Command Prompt." + exit 1 +} + +New-Item -Path "winflexbison-$arch" -Type Directory +cd "winflexbison-$arch" +cmake ` + -GNinja ` + -DCMAKE_BUILD_TYPE=Release ` + -DBUILD_TESTING=OFF ` + "../winflexbison/src" +cmake --build . +cpack -G ZIP +cd .. + +mv winflexbison-$arch/win_flex_bison-master.zip "winflexbison-$version-windows-$arch.zip" -- GitLab From a6901ba727af20042b7a6c9a3d84822619471b00 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Fri, 21 Mar 2025 19:42:43 +0100 Subject: [PATCH 2/2] gitlab-ci: add jobs to build and release `winflexbison` --- .gitlab-ci.yml | 61 ++++++++++++++++++++++++++++++++++++++ .gitlab/ci/make-release.sh | 8 +++++ 2 files changed, 69 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 535f956..5d469f8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1813,3 +1813,64 @@ release:vtkm: - package:vtkm-windows-x86_64 - job: upload:vtkm artifacts: false + +######################################################################## +# winflexbison +######################################################################## + +.winflexbison: + variables: + RELEASE_TAG_RE: /^winflexbison.v/ + +package:winflexbison-windows-x86_64: + extends: + - .winflexbison + - .rules + stage: ci + tags: + - windows-x86_64 + - concurrent + - shell + - msvc-19.35 + - vs2022 + variables: + GIT_CLONE_PATH: "$CI_BUILDS_DIR\\dawn" + # Avoid conflicting with other projects running on the same machine. + SCCACHE_SERVER_PORT: 4233 + VCVARSALL: "${VS170COMNTOOLS}\\..\\..\\VC\\Auxiliary\\Build\\vcvarsall.bat" + VCVARSPLATFORM: "x64" + VCVARSVERSION: "14.35.32215" + script: + - powershell -File ".gitlab/ci/cmake.ps1" + - powershell -File ".gitlab/ci/ninja.ps1" + - $pwdpath = $pwd.Path + - Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab;$pwdpath\.gitlab\cmake\bin;$env:PATH" + - cmake --version + - ninja --version + - Invoke-Expression -Command .gitlab/ci/vcvarsall.ps1 + - powershell -File "winflexbison/package-windows.ps1" + interruptible: true + artifacts: + expire_in: 1w + paths: + - winflexbison-*.zip + +upload:winflexbison: + extends: + - .upload_job + - .winflexbison + - .rules + needs: + - package:winflexbison-windows-x86_64 + variables: + UPLOAD_FILES: vtkm-* + +release:winflexbison: + extends: + - .release_job + - .winflexbison + - .rules + needs: + - package:winflexbison-windows-x86_64 + - job: upload:winflexbison + artifacts: false diff --git a/.gitlab/ci/make-release.sh b/.gitlab/ci/make-release.sh index 8697942..eb793cb 100755 --- a/.gitlab/ci/make-release.sh +++ b/.gitlab/ci/make-release.sh @@ -286,6 +286,14 @@ case "$CI_COMMIT_TAG" in --assets-link "{\"name\":\"$CI_COMMIT_TAG wasm32\",\"url\":\"$urlbase/$wasm32_emscripten_binary\"}" \ --assets-link "{\"name\":\"$CI_COMMIT_TAG wasm64\",\"url\":\"$urlbase/$wasm64_emscripten_binary\"}" ;; + winflexbison/v*) + # Asset discovery. + windows_x86_64="$( ls winflexbison-*-windows-x86_64.zip )" + readonly windows_x86_64 + + make_release \ + --assets-link "{\"name\":\"$CI_COMMIT_TAG Windows x86_64\",\"url\":\"$urlbase/$windows_x86_64\"}" + ;; *) echo >&2 "Unknown release artifact set." -- GitLab