Skip to content

Commit

Permalink
Merge remote-tracking branch 'alire/v3' into v4
Browse files Browse the repository at this point in the history
  • Loading branch information
mosteo committed Oct 9, 2024
2 parents 826cfc1 + b607671 commit 336a872
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 43 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/selftest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-12, macos-latest, windows-latest]
os: [ubuntu-latest, macos-12, macos-14, windows-latest]
target: [stable, nightly, source]

runs-on: ${{ matrix.os }}
Expand Down
67 changes: 25 additions & 42 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,55 +107,37 @@ runs:
shell: bash
run: echo "need=true" >> $GITHUB_OUTPUT

- name: Install GNAT (I) Linux
if: steps.need-GNAT.outputs.need == 'true' && runner.os == 'Linux'
uses: engineerd/[email protected]
with:
name: alr
url: https://github.com/alire-project/alire/releases/download/v2.0.0/alr-2.0.0-bin-x86_64-linux.zip
pathInArchive: bin/alr
- name: Install GNAT (I) macOS x86_84
if: steps.need-GNAT.outputs.need == 'true' && runner.os == 'macOS' && runner.arch == 'X64'
uses: engineerd/[email protected]
with:
name: alr
url: https://github.com/alire-project/alire/releases/download/v2.0.0/alr-2.0.0-bin-x86_64-macos.zip
pathInArchive: bin/alr
- name: Install GNAT (I) macOS aarch64
if: steps.need-GNAT.outputs.need == 'true' && runner.os == 'macOS' && runner.arch == 'ARM64'
uses: engineerd/[email protected]
with:
name: alr
url: https://github.com/alire-project/alire/releases/download/v2.0.0/alr-2.0.0-bin-aarch64-macos.zip
pathInArchive: bin/alr
- name: Install GNAT (I) Windows
if: steps.need-GNAT.outputs.need == 'true' && runner.os == 'Windows'
uses: engineerd/[email protected]
with:
name: alr.exe
url: https://github.com/alire-project/alire/releases/download/v2.0.0/alr-2.0.0-bin-x86_64-windows.zip
pathInArchive: bin/alr.exe

# Download a stable alr capable of installing a toolchain
- name: Install GNAT (I)
if: steps.need-GNAT.outputs.need == 'true'
shell: bash
run: |
os_lower=$(echo "${{ runner.os }}" | tr '[:upper:]' '[:lower:]')
alr_version=2.0.1
curl -L -O https://github.com/alire-project/alire/releases/download/v${alr_version}/alr-${alr_version}-bin-x86_64-${os_lower}.zip
unzip -o alr-${alr_version}-bin-x86_64-${os_lower}.zip "bin/alr*" -d tmp_alr
rm alr-${alr_version}-bin-x86_64-${os_lower}.zip
echo "$(pwd -W 2>/dev/null || pwd)/tmp_alr/bin" >> $GITHUB_PATH
# Perform the actual `alr install` and remove the `alr` just used to avoid
# conflicts with the `alr` being built.
# TODO: we use gnat^13 because there seems to be some trouble with gnat^14
# on macOS. Revisit this when the issue is resolved.
- name: Install GNAT (II)
if: steps.need-GNAT.outputs.need == 'true'
shell: bash
run: |
alr install gnat_native gprbuild --prefix=$PWD/setup_alire_prefix
alr install gnat_native^13 gprbuild^22 --prefix=$PWD/setup_alire_prefix
echo REMOVAL TARGET: $(which alr)
rm -f $(which alr)* && echo REMOVED stable alr used for toolchain install
rm -rf tmp_alr && echo REMOVED stable alr used for toolchain install
- name: Install GNAT (III) - Add to path (Windows)
if: steps.need-GNAT.outputs.need == 'true' && runner.os == 'Windows'
shell: pwsh
run: |
$Target = Resolve-Path .\setup_alire_prefix\bin
Add-Content $env:GITHUB_PATH $Target
- name: Install GNAT (III) - Add to path (!Windows)
if: steps.need-GNAT.outputs.need == 'true' && runner.os != 'Windows'
- name: Install GNAT (III) - Add to path
if: steps.need-GNAT.outputs.need == 'true'
shell: bash
run: |
readlink -f "$PWD/setup_alire_prefix/bin" >> $GITHUB_PATH
path_to_add=$(pwd -W 2>/dev/null || pwd)/setup_alire_prefix/bin
echo Adding to PATH: $path_to_add
echo "$path_to_add" >> $GITHUB_PATH
# END TOOLCHAIN INSTALLATION

Expand All @@ -178,7 +160,8 @@ runs:
if: steps.need-GNAT.outputs.need == 'true'
shell: bash
run: |
rm -rf setup_alire_prefix && echo REMOVED toolchain used to build alr
rm -rf setup_alire_prefix && \
echo REMOVED toolchain used to build alr at $PWD/setup_alire_prefix
# Display result for the record, and do some housekeeping
- shell: bash
Expand Down

0 comments on commit 336a872

Please sign in to comment.