Skip to content

Commit 907eb66

Browse files
committed
ci : add xcframework build to github releases
This commit adds the ability to create a GitHub release with the xcframework build artifact.
1 parent b4137c1 commit 907eb66

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

.github/workflows/build.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,31 @@ jobs:
708708
run: |
709709
./build-xcframework.sh
710710
711+
- name: Determine tag name
712+
id: tag
713+
shell: bash
714+
run: |
715+
BUILD_NUMBER="$(git rev-list --count HEAD)"
716+
SHORT_HASH="$(git rev-parse --short=7 HEAD)"
717+
if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
718+
echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
719+
else
720+
SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
721+
echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
722+
fi
723+
724+
- name: Pack artifacts
725+
id: pack_artifacts
726+
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
727+
run: |
728+
zip -r llama-${{ steps.tag.outputs.name }}-xcframework.zip build-apple/llama.xcframework
729+
730+
- name: Upload artifacts
731+
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
732+
uses: actions/upload-artifact@v4
733+
with:
734+
path: llama-${{ steps.tag.outputs.name }}-xcframework.zip
735+
711736
windows-msys2:
712737
runs-on: windows-latest
713738

0 commit comments

Comments
 (0)