Skip to content

Commit 1a77b9f

Browse files
DominicGBauerDominicGBauergithub-actions
authored
feat: add spm to deployment (#36)
* feat: add spm to deployment * chore: add test workflow to confirm everything works * chore: change action to run on push * chore: use macos 15 in action * Update Package.swift for version 0.3.0 * chore: change to zip and revert to macos-latest * Update Package.swift for version 0.3.0 * chore: pr reverts * chore: update name * chore: remove tar.xz --------- Co-authored-by: DominicGBauer <[email protected]> Co-authored-by: github-actions <[email protected]>
1 parent e3dad14 commit 1a77b9f

File tree

6 files changed

+36
-7
lines changed

6 files changed

+36
-7
lines changed

.github/workflows/ios.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828

2929
- name: Build iOS & macOS xcframework
3030
run: |
31-
./build-pod.sh
31+
./tool/build_xcframework.sh
3232
3333
- name: Lint pod
3434
run: |

.github/workflows/release.yml

+31-3
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
7474
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
7575

76-
publish_ios_pod:
76+
publish_ios_pod_and_spm_package:
7777
name: Publish iOS
7878
needs: [draft_release]
7979
runs-on: macos-latest
@@ -100,18 +100,46 @@ jobs:
100100

101101
- name: Build iOS & macOS xcframework
102102
run: |
103-
./build-pod.sh
103+
.tool/build_xcframework.sh
104104
105105
- name: Lint pod
106106
run: |
107107
pod lib lint
108108
109+
# For SPM package
110+
- name: Set xcFramework file name used for SPM package
111+
id: fileName
112+
run: |
113+
FILENAME=powersync-sqlite-core.xcframework.zip
114+
echo "fileName=$FILENAME" >> $GITHUB_OUTPUT
115+
109116
- name: Upload xcframework
110117
env:
111118
GH_TOKEN: ${{ github.token }}
112119
GH_REPO: ${{ github.repository }}
113120
run: |
114-
gh release upload "${{ needs.draft_release.outputs.tag }}" powersync-sqlite-core.xcframework.tar.xz
121+
gh release upload "${{ needs.draft_release.outputs.tag }}" ${{ steps.fileName.outputs.fileName }}
122+
123+
# For SPM package
124+
- name: Generate and add checksum to output
125+
id: checksum
126+
run: |
127+
CHECKSUM=$(swift package compute-checksum ${{ steps.fileName.outputs.fileName }})
128+
echo "checksum=$CHECKSUM" >> $GITHUB_OUTPUT
129+
- name: Dispatch release to SPM package
130+
uses: peter-evans/repository-dispatch@v3
131+
with:
132+
token: ${{ secrets.SWIFT_PUBLISH_TOKEN }}
133+
repository: powersync-ja/powersync-sqlite-core-swift
134+
event-type: spm-release
135+
client-payload: |-
136+
{
137+
"repository": "${{ github.repository }}",
138+
"title": "${{ needs.draft_release.outputs.tag }}",
139+
"tag": "${{ needs.draft_release.outputs.tag }}",
140+
"checksum": "${{ steps.checksum.outputs.checksum }}"
141+
"fileName": "${{ steps.fileName.outputs.fileName }}"
142+
}
115143
116144
publish_linux_x86_64:
117145
name: Publish Linux x86_64

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ target/
88
*.xcframework
99
*.tar.gz
1010
*.tar.xz
11+
*.zip

RELEASING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Bump the version number in these places:
66
2. powersync-sqlite-core.podspec.
77
3. android/build.gradle.kts
88
4. android/src/prefab/prefab.json
9-
5. build-pod.sh - CFBundleVersion and CFBundleShortVersionString.
9+
5. tool/build_xcframework.sh - CFBundleVersion and CFBundleShortVersionString.
1010
6. `cargo build` to update Cargo.lock
1111

1212
Create a tag:

powersync-sqlite-core.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ PowerSync extension for SQLite.
1010
s.license = 'Apache License, Version 2.0'
1111
s.author = 'Journey Mobile, Inc.'
1212

13-
s.source = { :http => "https://github.com/powersync-ja/powersync-sqlite-core/releases/download/v#{s.version}/powersync-sqlite-core.xcframework.tar.xz" }
13+
s.source = { :http => "https://github.com/powersync-ja/powersync-sqlite-core/releases/download/v#{s.version}/powersync-sqlite-core.xcframework.zip" }
1414
s.vendored_frameworks = 'powersync-sqlite-core.xcframework'
1515

1616

build-pod.sh renamed to tool/build_xcframework.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ EOF
6363
-output "${BUILD_DIR}/powersync-sqlite-core.xcframework"
6464

6565
cp -Rf "${BUILD_DIR}/powersync-sqlite-core.xcframework" "powersync-sqlite-core.xcframework"
66-
tar -cJvf powersync-sqlite-core.xcframework.tar.xz powersync-sqlite-core.xcframework LICENSE README.md
66+
zip -r powersync-sqlite-core.xcframework.zip powersync-sqlite-core.xcframework LICENSE README.md
6767
rm -rf ${BUILD_DIR}
6868
}
6969

0 commit comments

Comments
 (0)