Skip to content

Commit

Permalink
separate path setupprint
Browse files Browse the repository at this point in the history
  • Loading branch information
maxandersen committed Jul 18, 2023
1 parent 9100e62 commit 55495b5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
4 changes: 1 addition & 3 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ jobs:
----

IMPORTANT: This action requires Java 11+ to download and execute JReleaser. The action will setup a suitable Java runtime
automatically. If you would like to use a different Java version/distribution then set the value of `setup-java` to `false`
and make sure you have a previous step with `actions/setup-java` setup as needed.
IMPORTANT: This action requires Java 8+ to download and execute JBang. The action will setup a suitable Java runtime automatically if one is not available. GitHub runners seem to have a default Java 11 available. If you would like to use a different Java version/distribution then add a `actions/setup-java` as needed.

== Customizing

Expand Down
17 changes: 15 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,26 @@ runs:
echo "${HOME}/.jbang/bin" >> $GITHUB_PATH
${HOME}/.jbang/bin/jbang version
echo "::endgroup::"
- name: 'Setup JBang'

This comment has been minimized.

Copy link
@quintesse

quintesse Jul 18, 2023

Why is there a separate path setup? It seems to do exactly the same as the download step? (minus the download)

This comment has been minimized.

Copy link
@maxandersen

maxandersen Jul 19, 2023

Author Contributor

yeah - it works for linux but when i did it for windows it behaved as if the download step or the version print forced an exit.

so to not get stuck I just split them both to have them be consistent.

very welcome to see if you can make it work in one go - ultimately I think there is some bug in either jbang's ps1 script or in github's powershell handling.

This comment has been minimized.

Copy link
@quintesse

quintesse Jul 19, 2023

Yeah, I imagined, I just wondered why you split it for Linux as well

This comment has been minimized.

Copy link
@maxandersen

maxandersen Jul 19, 2023

Author Contributor

just to have them behave consistently to the user.

shell: bash
if: runner.os != 'Windows'
run: |
echo "::group::🔧 Setup JBang"
echo "${HOME}/.jbang/bin" >> $GITHUB_PATH
${HOME}/.jbang/bin/jbang version
echo "::endgroup::"
- name: 'Download JBang (Windows)'
shell: pwsh
if: runner.os == 'Windows'
run: |
echo "::group::⬇️ Download JBang"
iex "& { $(iwr https://ps.jbang.dev) } app setup"
echo "::endgroup::"
- name: 'Setup JBang (Windows)'
shell: pwsh
if: runner.os == 'Windows'
run: |
echo "::group::🔧 Setup JBang"
echo "$HOME\.jbang\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
& $HOME\.jbang\bin\jbang.ps1 version
echo $GITHUB_PATH
echo "::endgroup::"
echo "::endgroup::"

0 comments on commit 55495b5

Please sign in to comment.