@@ -85,138 +85,146 @@ jobs:
8585
8686 - name : Download artifact for this OS
8787 id : download_artifact
88- if : " !startsWith(matrix.os, 'macos-')"
88+ # if: "!startsWith(matrix.os, 'macos-')"
8989 shell : bash
9090 env :
9191 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
9292 run : |
9393 set -e
9494 mkdir -p ss3_artifacts
9595 os_artifact="${{ matrix.artifact_name }}"
96- readarray -t artifacts < <(echo '${{ steps.list_artifacts.outputs.artifacts }}' | jq -r '.[] | @base64')
97- if [[ ${#artifacts[@]} -eq 0 ]]; then
98- echo "No artifacts found."
99- exit 1
100- fi
101- echo "Available artifacts:"
102- for artifact in "${artifacts[@]}"; do
103- echo "${artifact}" | base64 --decode | jq -r '.name'
104- done
105- found_id=""
106- for artifact in "${artifacts[@]}"; do
107- _jq() {
108- echo "${artifact}" | base64 --decode | jq -r "${1}"
109- }
110- name=$(_jq '.name')
111- id=$(_jq '.id')
112- if [[ "$name" == "$os_artifact" ]]; then
113- found_id="$id"
114- break
115- fi
116- done
117- if [ -z "$found_id" ]; then
118- echo "Artifact $os_artifact not found!"
119- exit 1
120- fi
121- # Download the artifact
122- echo "Downloading artifact: $os_artifact"
123- gh api \
124- -H "Accept: application/vnd.github+json" \
125- -H "Authorization: Bearer $GH_TOKEN" \
126- "/repos/nmfs-ost/ss3-source-code/actions/artifacts/$found_id/zip" > "ss3_artifacts/$os_artifact.zip"
127-
128- - name : Download artifact for this OS mac
129- id : download_artifact-mac-silicon
130- if : runner.os == 'macos-latest'
131- shell : /opt/homebrew/bin/bash {0}
132- env :
133- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
134- run : |
135- set -e
136- mkdir -p ss3_artifacts
137- os_artifact="${{ matrix.artifact_name }}"
138- readarray -t artifacts < <(echo '${{ steps.list_artifacts.outputs.artifacts }}' | jq -r '.[] | @base64')
139- if [[ ${#artifacts[@]} -eq 0 ]]; then
140- echo "No artifacts found."
141- exit 1
96+ if [[ "${{ matrix.os }}" == "macos-13" ]]; then
97+ BASH_PATH="/usr/local/bin/bash"
98+ elif [[ "${{ matrix.os }}" == "macos-latest" ]]; then
99+ BASH_PATH="/opt/homebrew/bin/bash"
100+ else
101+ BASH_PATH="bash"
142102 fi
143- echo "Available artifacts:"
144- for artifact in "${artifacts[@]}"; do
145- echo "${artifact}" | base64 --decode | jq -r '.name'
146- done
147- found_id=""
148- for artifact in "${artifacts[@]}"; do
149- _jq() {
150- echo "${artifact}" | base64 --decode | jq -r "${1}"
151- }
152- name=$(_jq '.name')
153- id=$(_jq '.id')
154- if [[ "$name" == "$os_artifact" ]]; then
155- found_id="$id"
156- break
103+ $BASH_PATH -c '
104+ readarray -t artifacts < <(echo "${{ steps.list_artifacts.outputs.artifacts }}" | jq -r ".[] | @base64")
105+ if [[ ${#artifacts[@]} -eq 0 ]]; then
106+ echo "No artifacts found."
107+ exit 1
157108 fi
158- done
159- if [ -z "$found_id" ]; then
160- echo "Artifact $os_artifact not found!"
161- exit 1
162- fi
163- # Download the artifact
164- echo "Downloading artifact: $os_artifact"
165- gh api \
166- -H "Accept: application/vnd.github+json" \
167- -H "Authorization: Bearer $GH_TOKEN" \
168- "/repos/nmfs-ost/ss3-source-code/actions/artifacts/$found_id/zip" > "ss3_artifacts/$os_artifact.zip"
169-
170- - name : Download artifact for this OS mac
171- id : download_artifact-mac-intel
172- if : runner.os == 'macos-13'
173- shell : /usr/local/bin/bash {0}
174- env :
175- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
176- run : |
177- set -e
178- mkdir -p ss3_artifacts
179- os_artifact="${{ matrix.artifact_name }}"
180- readarray -t artifacts < <(echo '${{ steps.list_artifacts.outputs.artifacts }}' | jq -r '.[] | @base64')
181- if [[ ${#artifacts[@]} -eq 0 ]]; then
182- echo "No artifacts found."
183- exit 1
184- fi
185- echo "Available artifacts:"
186- for artifact in "${artifacts[@]}"; do
187- echo "${artifact}" | base64 --decode | jq -r '.name'
188- done
189- found_id=""
190- for artifact in "${artifacts[@]}"; do
191- _jq() {
192- echo "${artifact}" | base64 --decode | jq -r "${1}"
193- }
194- name=$(_jq '.name')
195- id=$(_jq '.id')
196- if [[ "$name" == "$os_artifact" ]]; then
197- found_id="$id"
198- break
109+ echo "Available artifacts:"
110+ for artifact in "${artifacts[@]}"; do
111+ echo "${artifact}" | base64 --decode | jq -r ".name"
112+ done
113+ found_id=""
114+ for artifact in "${artifacts[@]}"; do
115+ _jq() {
116+ echo "${artifact}" | base64 --decode | jq -r "${1}"
117+ }
118+ name=$(_jq ".name")
119+ id=$(_jq ".id")
120+ if [[ "$name" == "${os_artifact}" ]]; then
121+ found_id="$id"
122+ break
123+ fi
124+ done
125+ if [ -z "$found_id" ]; then
126+ echo "Artifact ${os_artifact} not found!"
127+ exit 1
199128 fi
200- done
201- if [ -z "$found_id" ]; then
202- echo "Artifact $os_artifact not found!"
203- exit 1
204- fi
205- # Download the artifact
206- echo "Downloading artifact: $os_artifact"
207- gh api \
208- -H "Accept: application/vnd.github+json" \
209- -H "Authorization: Bearer $GH_TOKEN" \
210- "/repos/nmfs-ost/ss3-source-code/actions/artifacts/$found_id/zip" > "ss3_artifacts/$os_artifact.zip"
211- - name : Unzip SS3 executable
212- shell : bash
213- run : |
214- cd ss3_artifacts
215- if [ "${{ runner.os }}" = "Windows" ]; then
216- powershell -Command "Expand-Archive -Path '${{ matrix.artifact_name }}.zip' -DestinationPath ."
217- else
218- unzip -o "${{ matrix.artifact_name }}.zip"
219- fi
129+ echo "Downloading artifact: ${os_artifact}"
130+ gh api \
131+ -H "Accept: application/vnd.github+json" \
132+ -H "Authorization: Bearer $GH_TOKEN" \
133+ "/repos/nmfs-ost/ss3-source-code/actions/artifacts/$found_id/zip" > "ss3_artifacts/${os_artifact}.zip"
134+ '
135+
136+ # - name: Download artifact for this OS mac
137+ # id: download_artifact-mac-silicon
138+ # if: runner.os == 'macos-latest'
139+ # shell: /opt/homebrew/bin/bash {0}
140+ # env:
141+ # GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
142+ # run: |
143+ # set -e
144+ # mkdir -p ss3_artifacts
145+ # os_artifact="${{ matrix.artifact_name }}"
146+ # readarray -t artifacts < <(echo '${{ steps.list_artifacts.outputs.artifacts }}' | jq -r '.[] | @base64')
147+ # if [[ ${#artifacts[@]} -eq 0 ]]; then
148+ # echo "No artifacts found."
149+ # exit 1
150+ # fi
151+ # echo "Available artifacts:"
152+ # for artifact in "${artifacts[@]}"; do
153+ # echo "${artifact}" | base64 --decode | jq -r '.name'
154+ # done
155+ # found_id=""
156+ # for artifact in "${artifacts[@]}"; do
157+ # _jq() {
158+ # echo "${artifact}" | base64 --decode | jq -r "${1}"
159+ # }
160+ # name=$(_jq '.name')
161+ # id=$(_jq '.id')
162+ # if [[ "$name" == "$os_artifact" ]]; then
163+ # found_id="$id"
164+ # break
165+ # fi
166+ # done
167+ # if [ -z "$found_id" ]; then
168+ # echo "Artifact $os_artifact not found!"
169+ # exit 1
170+ # fi
171+ # # Download the artifact
172+ # echo "Downloading artifact: $os_artifact"
173+ # gh api \
174+ # -H "Accept: application/vnd.github+json" \
175+ # -H "Authorization: Bearer $GH_TOKEN" \
176+ # "/repos/nmfs-ost/ss3-source-code/actions/artifacts/$found_id/zip" > "ss3_artifacts/$os_artifact.zip"
177+
178+ # - name: Download artifact for this OS mac
179+ # id: download_artifact-mac-intel
180+ # if: runner.os == 'macos-13'
181+ # shell: /usr/local/bin/bash {0}
182+ # env:
183+ # GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
184+ # run: |
185+ # set -e
186+ # mkdir -p ss3_artifacts
187+ # os_artifact="${{ matrix.artifact_name }}"
188+ # readarray -t artifacts < <(echo '${{ steps.list_artifacts.outputs.artifacts }}' | jq -r '.[] | @base64')
189+ # if [[ ${#artifacts[@]} -eq 0 ]]; then
190+ # echo "No artifacts found."
191+ # exit 1
192+ # fi
193+ # echo "Available artifacts:"
194+ # for artifact in "${artifacts[@]}"; do
195+ # echo "${artifact}" | base64 --decode | jq -r '.name'
196+ # done
197+ # found_id=""
198+ # for artifact in "${artifacts[@]}"; do
199+ # _jq() {
200+ # echo "${artifact}" | base64 --decode | jq -r "${1}"
201+ # }
202+ # name=$(_jq '.name')
203+ # id=$(_jq '.id')
204+ # if [[ "$name" == "$os_artifact" ]]; then
205+ # found_id="$id"
206+ # break
207+ # fi
208+ # done
209+ # if [ -z "$found_id" ]; then
210+ # echo "Artifact $os_artifact not found!"
211+ # exit 1
212+ # fi
213+ # # Download the artifact
214+ # echo "Downloading artifact: $os_artifact"
215+ # gh api \
216+ # -H "Accept: application/vnd.github+json" \
217+ # -H "Authorization: Bearer $GH_TOKEN" \
218+ # "/repos/nmfs-ost/ss3-source-code/actions/artifacts/$found_id/zip" > "ss3_artifacts/$os_artifact.zip"
219+ # - name: Unzip SS3 executable
220+ # shell: bash
221+ # run: |
222+ # cd ss3_artifacts
223+ # if [ "${{ runner.os }}" = "Windows" ]; then
224+ # powershell -Command "Expand-Archive -Path '${{ matrix.artifact_name }}.zip' -DestinationPath ."
225+ # else
226+ # unzip -o "${{ matrix.artifact_name }}.zip"
227+ # fi
220228
221229 - name : Checkout test models repository
222230 uses : actions/checkout@v4
0 commit comments