From ef7661905bca08df1267a6a848ed390999693342 Mon Sep 17 00:00:00 2001 From: Robert-96 Date: Tue, 9 Aug 2022 02:25:59 +0300 Subject: [PATCH 1/2] Add support for macOS-based workflows --- action.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 0ef001d..8df3585 100644 --- a/action.yml +++ b/action.yml @@ -14,7 +14,7 @@ runs: steps: - name: Archive artifact shell: bash - if: runner.os != 'Windows' + if: runner.os == 'Linux' run: | tar \ --dereference --hard-dereference \ @@ -24,6 +24,19 @@ runs: --exclude=.github \ . + # Remove the --hard-dereference option for macOS only + - name: Archive artifact + shell: bash + if: runner.os == 'macOS' + run: | + tar \ + --dereference \ + --directory ${{ inputs.path }} \ + -cvf ${{ runner.temp }}/artifact.tar \ + --exclude=.git \ + --exclude=.github \ + . + # Massage the paths for Windows only - name: Archive artifact shell: bash From e361946409ca6c2785db51e594f65f03fc3e4070 Mon Sep 17 00:00:00 2001 From: Dezmerean Robert Date: Tue, 9 Aug 2022 21:49:27 +0300 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Yoann Chaudet --- action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/action.yml b/action.yml index 8df3585..0d354cb 100644 --- a/action.yml +++ b/action.yml @@ -24,13 +24,13 @@ runs: --exclude=.github \ . - # Remove the --hard-dereference option for macOS only + # Switch to gtar (GNU tar instead of bsdtar which is the default in the MacOS runners so we can use --hard-dereference) - name: Archive artifact shell: bash if: runner.os == 'macOS' run: | - tar \ - --dereference \ + gtar \ + --dereference --hard-dereference \ --directory ${{ inputs.path }} \ -cvf ${{ runner.temp }}/artifact.tar \ --exclude=.git \