Skip to content

Commit e4eeb27

Browse files
authored
Update build-xcframework.yml
1 parent 08da35a commit e4eeb27

File tree

1 file changed

+32
-16
lines changed

1 file changed

+32
-16
lines changed

.github/workflows/build-xcframework.yml

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -83,38 +83,54 @@ jobs:
8383
echo "version=v${{ github.run_number }}" >> $GITHUB_OUTPUT
8484
fi
8585
86-
- name: Create Release
87-
id: create_release
88-
uses: softprops/action-gh-release@v1
86+
- name: List output directory
87+
run: |
88+
echo "Current working directory: $(pwd)"
89+
echo "OUTPUT_DIR: ${{ env.OUTPUT_DIR }}"
90+
echo "Contents of OUTPUT_DIR:"
91+
ls -la ${{ env.OUTPUT_DIR }}
92+
echo "Full paths of .xcframework directories:"
93+
find ${{ env.OUTPUT_DIR }} -name "*.xcframework" -type d
94+
echo "Structure of .xcframework directories:"
95+
find ${{ env.OUTPUT_DIR }} -name "*.xcframework" -type d -exec sh -c 'echo "{}:"; ls -R "{}"' \;
96+
97+
- name: Zip XCFrameworks
98+
run: |
99+
cd ${{ env.OUTPUT_DIR }}
100+
for framework in *.xcframework; do
101+
zip -r "${framework%.xcframework}.xcframework.zip" "$framework"
102+
done
103+
ls -la
104+
105+
- name: Create Release and Upload XCFrameworks
106+
uses: softprops/action-gh-release@v2
89107
if: github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main') || github.event_name == 'workflow_dispatch'
90108
with:
91109
tag_name: ${{ steps.version.outputs.version }}
92110
name: Release ${{ steps.version.outputs.version }}
93111
draft: false
94112
prerelease: false
95113
generate_release_notes: true
96-
97-
- name: Upload XCFrameworks to Release
98-
uses: softprops/action-gh-release@v1
99-
if: github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main') || github.event_name == 'workflow_dispatch'
100-
with:
101-
files: ${{ env.OUTPUT_DIR }}/*.xcframework
102-
tag_name: ${{ steps.version.outputs.version }}
114+
fail_on_unmatched_files: true
115+
files: |
116+
${{ env.OUTPUT_DIR }}/*.xcframework.zip
103117
env:
104118
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
105119

106120
- name: Check Release
107121
run: |
108122
echo "Checking release ${{ steps.version.outputs.version }}"
109-
release_info=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
123+
release_info=$(curl -sS -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
110124
https://api.github.com/repos/${{ github.repository }}/releases/tags/${{ steps.version.outputs.version }})
111-
echo "Release info: $release_info"
112-
assets=$(echo $release_info | jq '.assets')
113-
echo "Release assets: $assets"
125+
echo "Release info:"
126+
echo "$release_info" | jq '.'
127+
assets=$(echo "$release_info" | jq -r '.assets[].name')
128+
echo "Release assets:"
129+
echo "$assets"
114130
115-
- name: Upload XCFrameworks
131+
- name: Upload XCFrameworks as Workflow Artifacts
116132
uses: actions/upload-artifact@v4
117133
with:
118134
name: XCFrameworks
119-
path: ${{ env.OUTPUT_DIR }}/*.xcframework
135+
path: ${{ env.OUTPUT_DIR }}/*.xcframework.zip
120136
if-no-files-found: error

0 commit comments

Comments
 (0)