Skip to content

Commit 26236fd

Browse files
committed
build: improve GH workflow (no double zipping, skipping release on manual runs)
1 parent 1cfb006 commit 26236fd

1 file changed

Lines changed: 25 additions & 16 deletions

File tree

.github/workflows/build-xcframework.yml

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ on:
44
release:
55
types: [published]
66
workflow_dispatch: # Manual trigger
7-
push: # temporal, letting GH know this exist
7+
push:
8+
branches:
9+
- amanowicz/KG-682_spm_support
810

911
jobs:
1012
build-xcframework:
@@ -54,27 +56,34 @@ jobs:
5456
./gradlew :koog-agents:assembleXCFramework --no-daemon --stacktrace
5557
echo "XCFramework binary assembled"
5658
57-
- name: Create XCFramework zip
58-
run: |
59-
cd koog-agents/build/XCFrameworks/release
60-
zip -r koog_agents-${{ steps.version.outputs.version }}.xcframework.zip koog_agents.xcframework
61-
echo "XCFramework zip created:"
62-
ls -lh koog_agents-${{ steps.version.outputs.version }}.xcframework.zip
63-
# Calculate checksum for SPM
64-
shasum -a 256 koog_agents-${{ steps.version.outputs.version }}.xcframework.zip
65-
66-
- name: Upload XCFramework artifact
59+
# Uploading XCF binary on manual runs without polluting the release - for debugging & testing
60+
# Note that 'actions/upload-artifact@v4' always zips the artifact, so we don't have to do it for manual runs
61+
- name: Upload XCFramework artifact for manual runs
62+
# disable for branch test
63+
#if: github.event_name == 'workflow_dispatch'
6764
uses: actions/upload-artifact@v4
6865
with:
6966
name: koog-agents-xcframework-${{ steps.version.outputs.version }}
70-
path: koog-agents/build/XCFrameworks/release/koog_agents-${{ steps.version.outputs.version }}.xcframework.zip
67+
path: koog-agents/build/XCFrameworks/release/
7168
retention-days: 30
7269

73-
- name: Upload to release
74-
if: false # Temporarily disabled
75-
#if: github.event_name == 'release'
70+
- name: Create XCFramework zip for release
71+
if: github.event_name == 'release'
72+
id: archive
73+
run: |
74+
ARCHIVE_NAME="koog_agents-${{ steps.version.outputs.version }}.xcframework.zip"
75+
cd koog-agents/build/XCFrameworks/release
76+
zip -r "$ARCHIVE_NAME" koog_agents.xcframework
77+
echo "archive_path=$(pwd)/$ARCHIVE_NAME" >> $GITHUB_OUTPUT
78+
echo "XCFramework zip created:"
79+
ls -lh "$ARCHIVE_NAME"
80+
# Calculate checksum for SPM
81+
shasum -a 256 "$ARCHIVE_NAME"
82+
83+
- name: Upload XCFramework artifact to release
84+
if: github.event_name == 'release'
7685
uses: softprops/action-gh-release@v2
7786
with:
78-
files: koog-agents/build/XCFrameworks/release/koog_agents-${{ steps.version.outputs.version }}.xcframework.zip
87+
files: ${{ steps.archive.outputs.archive_path }}
7988
env:
8089
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)