Skip to content

Commit

Permalink
Improve coloring also for other runner OS variants.
Browse files Browse the repository at this point in the history
  • Loading branch information
Paebbels committed Jan 11, 2025
1 parent b33fa10 commit 58974c6
Showing 1 changed file with 40 additions and 9 deletions.
49 changes: 40 additions & 9 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ runs:
run: |
tee "${GITHUB_OUTPUT}" <<EOF
nightly-version=5.0.0-dev
nightly-version-msys2=5.0.0.dev-1
EOF
- name: Debugging
Expand All @@ -50,6 +51,7 @@ runs:
if: runner.os == 'Linux' && runner.arch == 'X64'
shell: bash
run: |
# Download and install GHDL on Ubuntu 2024.04 (x86-64)
ANSI_LIGHT_BLUE="\e[94m"
ANSI_NOCOLOR=$'\x1b[0m'
Expand Down Expand Up @@ -122,8 +124,12 @@ runs:
if: runner.os == 'macOS' && ( runner.arch == 'X64' || runner.arch == 'ARM64' )
shell: bash
run: |
# Download and install GHDL on macOS (${{ runner.arch }})
ANSI_LIGHT_BLUE="\e[94m"
ANSI_NOCOLOR=$'\x1b[0m'
# TODO: check macOS version
if [[ "${{ runner.arch }}" == "X64" ]]; then
OS_RELEASE=13
OS_ARCH=x86_64
Expand Down Expand Up @@ -163,13 +169,24 @@ runs:
mkdir -p "${{ inputs.install-directory }}"
cd "${{ inputs.install-directory }}"
printf "Downloading asset and extracting tar.gz file ...\n"
curl -L "https://github.com/ghdl/ghdl/releases/download/${VERSION_IN_URL}/ghdl-${{ inputs.backend }}-${VERSION_IN_FILE}-macos${OS_RELEASE}-${OS_ARCH}.tar.gz" | tar -xz --strip-components 1
(
DOWNLOAD_URL="https://github.com/ghdl/ghdl/releases/download/${VERSION_IN_URL}/ghdl-${{ inputs.backend }}-${VERSION_IN_FILE}-macos${OS_RELEASE}-${OS_ARCH}.tar.gz"
printf "::group::${ANSI_LIGHT_BLUE}%s${ANSI_NOCOLOR}\n" "Downloading asset and extracting '${DOWNLOAD_URL}' file ..."
curl -L "${DOWNLOAD_URL}" | tar -xz --strip-components 1
printf "::endgroup::\n"
if [[ "${{ inputs.investigate }}" == "true" ]]; then
cd bin
pwd
printf "::group::${ANSI_LIGHT_BLUE}%s.${ANSI_NOCOLOR}\n" "Content of '$(pwd)'"
# tree is not supported on macOS
# tree -pash .
ls -lAh .
)
printf "::endgroup::\n"
fi
printf "::group::${ANSI_LIGHT_BLUE}%s.${ANSI_NOCOLOR}\n" "Installing dependencies from './ubuntu.requirements' using 'apt-get' ..."
sudo xargs --no-run-if-empty -a ./ubuntu.requirements -- apt-get install -y --no-install-recommends
printf "::endgroup::\n"
)
printf "Setting environment variable 'GHDL_PREFIX' ...\n"
Expand All @@ -192,14 +209,23 @@ runs:
curl -L "https://github.com/ghdl/ghdl/releases/download/${VERSION_IN_URL}/mingw-w64-ucrt-x86_64-ghdl-mcode-5.0.0.dev-1-any.pkg.tar.zst" -o ghdl.pkg.tar.zst
- name: Download and install GHDL on Windows + UCRT64 (x86-64)
id: UCRT64
- name: Download and install GHDL on Windows + MSYS2 (x86-64)
id: MSYS2
if: runner.os == 'Windows' && runner.arch == 'X64' && ( inputs.runtime == 'mingw64' || inputs.runtime == 'ucrt64' )
shell: 'msys2 {0}'
run: |
# Download and install GHDL on Windows + MSYS2 (x86-64)
ANSI_LIGHT_BLUE="\e[94m"
ANSI_NOCOLOR=$'\x1b[0m'
if [[ ${{ inputs.runtime }} == "mingw64" ]]; then
RUNTIME=""
elif [[ ${{ inputs.runtime }} == "ucrt64" ]]; then
RUNTIME="ucrt-"
if [[ "${{ inputs.version }}" == "nightly" ]]; then
VERSION_IN_URL="nightly"
VERSION_IN_FILE="${{ steps.variables.outputs.nightly-version }}"
VERSION_IN_FILE="${{ steps.variables.outputs.nightly-version-msys2 }}"
printf "Version: %s\n" "nightly (${VERSION_IN_FILE})"
elif [[ "${{ inputs.version }}" =~ ^[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2}$ ]]; then
Expand All @@ -219,7 +245,12 @@ runs:
exit 1
fi
curl -L "https://github.com/ghdl/ghdl/releases/download/${VERSION_IN_URL}/mingw-w64-ucrt-x86_64-ghdl-mcode-5.0.0.dev-1-any.pkg.tar.zst" -o ghdl.pkg.tar.zst
DOWNLOAD_URL="https://github.com/ghdl/ghdl/releases/download/${VERSION_IN_URL}/mingw-w64-${RUNTIME}x86_64-ghdl-${{ inputs.backend }}-${VERSION_IN_FILE}-any.pkg.tar.zst"
printf "::group::${ANSI_LIGHT_BLUE}%s${ANSI_NOCOLOR}\n" "Downloading asset from '${DOWNLOAD_URL}' ..."
curl -L "${DOWNLOAD_URL}" | tar -xz --strip-components 1
printf "::endgroup::\n"
printf "::group::${ANSI_LIGHT_BLUE}%s${ANSI_NOCOLOR}\n" "Installing 'ghdl.pkg.tar.zst' file ..."
pacman -U --noconfirm ghdl.pkg.tar.zst
which ghdl
Expand Down

0 comments on commit 58974c6

Please sign in to comment.