Skip to content

Commit 050fd10

Browse files
committed
fix artifact path
1 parent 76630d1 commit 050fd10

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

action.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,30 @@ runs:
108108
github-token: ${{ inputs.github-token }}
109109
pr-number: ${{ github.event.pull_request.number }}
110110

111+
- name: Set ARTIFACT_PATH from existing artifact
112+
if: ${{ steps.find-artifact.outputs.artifact-url && inputs.re-sign != 'true' && env.ARTIFACT_PATH == '' }}
113+
run: |
114+
curl -L -H "Authorization: token ${{ inputs.github-token }}" \
115+
-o artifact.zip \
116+
"https://api.github.com/repos/${{ github.repository }}/actions/artifacts/${{ steps.find-artifact.outputs.artifact-id }}/zip"
117+
118+
unzip artifact.zip -d downloaded-artifacts
119+
ls -l downloaded-artifacts
120+
121+
if [ "${{ inputs.destination }}" == "device" ]; then
122+
ARTIFACT_PATH=$(find downloaded-artifacts -name "*.ipa" -print -quit)
123+
else
124+
ARTIFACT_PATH=$(find downloaded-artifacts -name "*.tar.gz" -print -quit)
125+
fi
126+
127+
if [ -z "$ARTIFACT_PATH" ]; then
128+
echo "No build artifact found in the extracted contents."
129+
exit 1
130+
fi
131+
132+
echo "ARTIFACT_PATH=$ARTIFACT_PATH" >> $GITHUB_ENV
133+
shell: bash
134+
111135
- name: Install Java
112136
if: ${{ !steps.find-artifact.outputs.artifact-url }}
113137
uses: actions/setup-java@v4

0 commit comments

Comments
 (0)