From ce66e3184b7a1bce3d2533a09e5d196d4e09c840 Mon Sep 17 00:00:00 2001 From: Jonah Beckford <71855677+jonahbeckford@users.noreply.github.com> Date: Thu, 23 Nov 2023 13:43:39 -0800 Subject: [PATCH] ci: Build and release dkml and with-dkml (2/n) + Set diskuv-opam-repository version earlier + pin dkml-* package to DkML version Part of https://github.com/diskuv/dkml-installer-ocaml/issues/80 --- .github/workflows/dkml.yml | 11 +++++++++++ ci/build-test.sh | 12 ++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/.github/workflows/dkml.yml b/.github/workflows/dkml.yml index 72fa248..484cdf1 100644 --- a/.github/workflows/dkml.yml +++ b/.github/workflows/dkml.yml @@ -62,6 +62,14 @@ jobs: - name: Checkout code uses: actions/checkout@v3 + - name: Promote version on Windows host + if: startsWith(matrix.dkml_host_abi, 'windows_') + run: echo "DISKUV_OPAM_REPOSITORY=$(Get-Content ${env:GITHUB_WORKSPACE}/src/runtimelib/version.txt)" >> $env:GITHUB_ENV + + - name: Promote version on Unix host + if: "!startsWith(matrix.dkml_host_abi, 'windows_')" + run: echo "DISKUV_OPAM_REPOSITORY=$(cat src/runtimelib/version.txt)" >> $GITHUB_ENV + - name: Cache DkML compilers code uses: actions/cache@v3 id: cache-dkml-compilers @@ -83,18 +91,21 @@ jobs: with: DKML_COMPILER: ${{ env.DKML_COMPILER }} CACHE_PREFIX: ${{ env.CACHE_PREFIX }} + DISKUV_OPAM_REPOSITORY: ${{ env.DISKUV_OPAM_REPOSITORY }} - name: Setup DkML compilers on a Linux host if: startsWith(matrix.dkml_host_abi, 'linux_') uses: ./.ci/dkml-compilers/gh-linux/pre with: DKML_COMPILER: ${{ env.DKML_COMPILER }} CACHE_PREFIX: ${{ env.CACHE_PREFIX }} + DISKUV_OPAM_REPOSITORY: ${{ env.DISKUV_OPAM_REPOSITORY }} - name: Setup DkML compilers on a Darwin host if: startsWith(matrix.dkml_host_abi, 'darwin_') uses: ./.ci/dkml-compilers/gh-darwin/pre with: DKML_COMPILER: ${{ env.DKML_COMPILER }} CACHE_PREFIX: ${{ env.CACHE_PREFIX }} + DISKUV_OPAM_REPOSITORY: ${{ env.DISKUV_OPAM_REPOSITORY }} # This section is for your own build logic which you should place in # ci/build-test.sh or a similar file diff --git a/ci/build-test.sh b/ci/build-test.sh index d516fec..0b098b7 100755 --- a/ci/build-test.sh +++ b/ci/build-test.sh @@ -54,7 +54,8 @@ build-test.sh ---- DkML ---- -$dkml_version +dkml_version=$dkml_version +DISKUV_OPAM_REPOSITORY=${DISKUV_OPAM_REPOSITORY:-} . --------- Arguments @@ -85,9 +86,12 @@ opamrun exec -- ocamlc -config # Update opamrun update -# Reset repository to match the current version of DkML, not the dkml-workflows' version -opamrun repository remove diskuv --all || true -opamrun repository add diskuv "git+https://github.com/diskuv/diskuv-opam-repository.git#$dkml_version" +# Let dkml-* packages use their own versions (the DkML version), not the pins from [dkml-workflows] +opamrun pin remove dkml-compiler-env --yes --no-action || true # dkml-compiler-env will disappear +opamrun pin dkml-compiler-src -k version "$dkml_version" --yes --no-action +opamrun pin dkml-runtime-common -k version "$dkml_version" --yes --no-action +opamrun pin dkml-runtime-distribution -k version "$dkml_version" --yes --no-action +opamrun upgrade dkml-compiler-src dkml-runtime-common dkml-runtime-distribution --yes # Make your own build logic! It may look like ... opamrun install . --deps-only --with-test --yes