Skip to content

Commit

Permalink
Export the JULIA_PKG_SERVER_REGISTRY_PREFERENCE variable for subseque…
Browse files Browse the repository at this point in the history
…nt steps. (#33)
  • Loading branch information
fredrikekre authored Mar 13, 2023
1 parent 7c59a05 commit 72ddd0f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
4 changes: 3 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"

0 comments on commit 72ddd0f

Please sign in to comment.