Skip to content

Commit

Permalink
[macos] Fix latest macos (#47)
Browse files Browse the repository at this point in the history
### Summary
Fixes compatibility with macos-14.

macos-14 changed the location of `gtar`, this PR fixes that.
  • Loading branch information
mikeland73 committed May 9, 2024
1 parent e55980d commit a03caf5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 19 deletions.
21 changes: 7 additions & 14 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,18 @@ permissions:

jobs:
test-action:
runs-on: ubuntu-latest
strategy:
matrix:
os: [macos-12, macos-13, macos-14, macos-latest, ubuntu-latest]
use-cache: [true, false]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install devbox
uses: ./
with:
project-path: 'testdata'
enable-cache: ${{ matrix.use-cache }}
disable-nix-access-token: "${{ github.ref != 'refs/heads/main' }}"

test-action-with-version:
Expand All @@ -42,17 +47,6 @@ jobs:
project-path: 'testdata'
disable-nix-access-token: "${{ github.ref != 'refs/heads/main' }}"

test-action-with-cache:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install devbox
uses: ./
with:
enable-cache: true
project-path: 'testdata'
disable-nix-access-token: "${{ github.ref != 'refs/heads/main' }}"

test-action-with-sha256-checksum:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -92,8 +86,7 @@ jobs:
uses: ./
with:
devbox-version: 0.9.1
enable-cache: true
refresh-cli: true
sha256-checksum: '3cf9bdffbdcc73f49f99f90df7092379589ef2e90f994cfc0163d2ff07a1f189'
sha256-checksum: 'e7793acf6dadecc6a04eb64d6352665698c75f6c9f59fbe3efee3b04dbec294d'
project-path: 'testdata'
disable-nix-access-token: "${{ github.ref != 'refs/heads/main' }}"
12 changes: 7 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,11 @@ runs:
shell: bash
run: |
if [ "$RUNNER_OS" == "macOS" ]; then
sudo mv /usr/local/bin/gtar /usr/local/bin/gtar.orig
echo "#!/bin/sh" >> /usr/local/bin/gtar
echo 'exec sudo /usr/local/bin/gtar.orig "$@"' >> /usr/local/bin/gtar
sudo chmod +x /usr/local/bin/gtar
gtar_path=$(which gtar)
sudo mv $gtar_path $gtar_path.orig
echo "#!/bin/sh" >> $gtar_path
echo "exec sudo $gtar_path.orig \"\$@\"" >> $gtar_path
sudo chmod +x $gtar_path
elif [ "$RUNNER_OS" == "Linux" ]; then
mkdir -p ~/.cache
mkdir -p ~/.local/bin
Expand Down Expand Up @@ -171,7 +172,8 @@ runs:
shell: bash
run: |
if [ "$RUNNER_OS" == "macOS" ]; then
sudo mv /usr/local/bin/gtar.orig /usr/local/bin/gtar
gtar_path=$(which gtar)
sudo mv $gtar_path.orig $gtar_path
elif [ "$RUNNER_OS" == "Linux" ]; then
rm ~/.local/bin/tar
fi

0 comments on commit a03caf5

Please sign in to comment.