From 72ddd0fcdc760e6d2ef7ef2bbb11ae5032b671a8 Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Mon, 13 Mar 2023 18:32:34 +0100 Subject: [PATCH] Export the JULIA_PKG_SERVER_REGISTRY_PREFERENCE variable for subsequent steps. (#33) --- README.md | 10 ++++++++++ action.yml | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e486180..909b88d 100644 --- a/README.md +++ b/README.md @@ -33,3 +33,13 @@ jobs: - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-runtest@v1 ``` + + +### Registry flavor preference + +This actions defines (and exports for subsequent steps of the workflow) the +environmental variable `JULIA_PKG_SERVER_REGISTRY_PREFERENCE=eager` unless it +is already set. If you want another registry flavor (i.e. `conservative`) this +should be defined in the `env:` section of the relevant workflow or step. See +[Registry flavors](https://pkgdocs.julialang.org/dev/registries/#Registry-flavors) +for more information. diff --git a/action.yml b/action.yml index 0f2e7f2..9ca9427 100644 --- a/action.yml +++ b/action.yml @@ -17,11 +17,13 @@ inputs: runs: using: 'composite' steps: + - name: Set and export registry flavor preference + run: echo "JULIA_PKG_SERVER_REGISTRY_PREFERENCE=${JULIA_PKG_SERVER_REGISTRY_PREFERENCE:-eager}" >> ${GITHUB_ENV} + shell: bash - run: | import Pkg VERSION >= v"1.5-" && Pkg.Registry.add("General") VERSION >= v"1.1.0-rc1" ? Pkg.build(verbose=true) : Pkg.build() shell: julia --color=yes --project=${{ inputs.project }} {0} env: - JULIA_PKG_SERVER_REGISTRY_PREFERENCE: "${{ env.JULIA_PKG_SERVER_REGISTRY_PREFERENCE == '' && 'eager' || env.JULIA_PKG_SERVER_REGISTRY_PREFERENCE }}" JULIA_PKG_PRECOMPILE_AUTO: "${{ inputs.precompile }}"