Skip to content

Commit

Permalink
ci: Build and release dkml and with-dkml (2/n)
Browse files Browse the repository at this point in the history
+ Set diskuv-opam-repository version earlier
+ pin dkml-* package to DkML version

Part of diskuv/dkml-installer-ocaml#80
  • Loading branch information
jonahbeckford committed Nov 23, 2023
1 parent fdb5506 commit ce66e31
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/dkml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
12 changes: 8 additions & 4 deletions ci/build-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ build-test.sh
----
DkML
----
$dkml_version
dkml_version=$dkml_version
DISKUV_OPAM_REPOSITORY=${DISKUV_OPAM_REPOSITORY:-}
.
---------
Arguments
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ce66e31

Please sign in to comment.