diff --git a/.github/workflows/dkml-release.yml b/.github/workflows/dkml-release.yml index 2ac468a..e63eeed 100644 --- a/.github/workflows/dkml-release.yml +++ b/.github/workflows/dkml-release.yml @@ -1,11 +1,24 @@ -# Maintainer note: This .yml file is used as the simple example of setup-dkml.yml@v1. Keep it simple and documented! +########################################################################## +# File: .github/workflows/dkml-release.yml # +# # +# Copyright 2022 Diskuv, Inc. # +# # +# Licensed under the Open Software License version 3.0 # +# (the "License"); you may not use this file except in compliance # +# with the License. You may obtain a copy of the License at # +# # +# https://opensource.org/license/osl-3-0-php/ # +# # +########################################################################## + +# Maintainer note: This .yml file is used as the simple example of dkml-workflows. Keep it simple and documented! name: Create diskuvbox releases env: OPAM_PACKAGE: "diskuvbox" EXECUTABLE_NAME: "diskuvbox" - DKML_COMPILER: "" # You can override the dkml-compiler package version. Example: 4.12.1-v1.0.2 + DKML_COMPILER: "" # You can override the dkml-compiler package version. Example: 2.0.2 CACHE_PREFIX: "v1" # Secondary switch 'two' used to install opam-installer for Dune-ified crosscompiling builds SECONDARY_SWITCH: "true" @@ -59,33 +72,46 @@ jobs: key: "${{ runner.os }}-cross-${{ hashFiles('ci/*.sh') }}" - # The Setup DKML action will create the environment variables: - # opam_root, exe_ext, dkml_host_abi, abi_pattern (and many more) + - name: Cache DkML compilers code + uses: actions/cache@v3 + id: cache-dkml-compilers + with: + path: .ci/dkml-compilers + key: ${{ runner.os }} + + - name: Checkout DkML compilers code + if: steps.cache-dkml-compilers.outputs.cache-hit != 'true' + # For help: ./dk dkml.workflow.compilers HELP + run: ./dk dkml.workflow.compilers PRERELEASE CI GitHub - - name: Setup DKML on a Windows host + # The .ci/dkml-compilers "pre" actions will create the environment variables: + # opam_root, exe_ext, dkml_host_abi, abi_pattern (and many more) + # + - name: Setup DkML compilers on a Windows host if: startsWith(matrix.dkml_host_abi, 'windows_') - uses: ./ci/setup-dkml/gh-windows/pre + uses: ./.ci/dkml-compilers/gh-windows/pre with: DKML_COMPILER: ${{ env.DKML_COMPILER }} CACHE_PREFIX: ${{ env.CACHE_PREFIX }} SECONDARY_SWITCH: ${{ env.SECONDARY_SWITCH }} - - - name: Setup DKML on a Darwin host - if: startsWith(matrix.dkml_host_abi, 'darwin_') - uses: ./ci/setup-dkml/gh-darwin/pre + - 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 }} SECONDARY_SWITCH: ${{ env.SECONDARY_SWITCH }} - - - name: Setup DKML on a Linux host - if: startsWith(matrix.dkml_host_abi, 'linux_') - uses: ./ci/setup-dkml/gh-linux/pre + - 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 }} SECONDARY_SWITCH: ${{ env.SECONDARY_SWITCH }} + # This section is for your own build logic which you should place in + # ci/build-test.sh or a similar file + - name: Build and test the package on Windows host if: startsWith(matrix.dkml_host_abi, 'windows_') shell: msys2 {0} @@ -95,17 +121,21 @@ jobs: if: "!startsWith(matrix.dkml_host_abi, 'windows_')" run: ci/build-test.sh --opam-package ${{ env.OPAM_PACKAGE }} --executable-name ${{ env.EXECUTABLE_NAME }} - - name: Teardown DKML on a Windows host + # The .ci/dkml-compilers "post" actions will finalize caching, etc. + + - name: Teardown DkML compilers on a Windows host if: startsWith(matrix.dkml_host_abi, 'windows_') - uses: ./ci/setup-dkml/gh-windows/post + uses: ./.ci/dkml-compilers/gh-windows/post - - name: Teardown DKML on a Darwin host + - name: Teardown DkML compilers on a Darwin host if: startsWith(matrix.dkml_host_abi, 'darwin_') - uses: ./ci/setup-dkml/gh-darwin/post + uses: ./.ci/dkml-compilers/gh-darwin/post - - name: Teardown DKML on a Linux host + - name: Teardown DkML compilers on a Linux host if: startsWith(matrix.dkml_host_abi, 'linux_') - uses: ./ci/setup-dkml/gh-linux/post + uses: ./.ci/dkml-compilers/gh-linux/post + + # Upload artifact - uses: actions/upload-artifact@v3 with: