Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
on:
repository_dispatch:
types: [spm-release]
name: "release"
jobs:
release:
name: Release SPM package
runs-on: macos-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3

# For SPM package
# We use peter-evans/repository-dispatch to receive the release event information in client_payload
# "repository"
# "title"
# "tag"
# "checksum"
# "fileName"
# For more information see https://github.com/powersync-ja/powersync-sqlite-core/blob/aa09d5dc499bf8d5be383ad95d58cba410ceade7/.github/workflows/release.yml#L76
- name: Update Package.swift with information from powersync-sqlite-core release
run: |
sed -i '' \
-e "s|url: \".*\"|url: \"https://github.com/${{ github.event.client_payload.repository }}/releases/download/${{ github.event.client_payload.tag }}/${{ github.event.client_payload.fileName }}\"|" \
-e "s|checksum: \".*\"|checksum: \"${{ github.event.client_payload.checksum }}\"|" \
Package.swift

- name: Commit and push updated Package.swift
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name github-actions
git config user.email [email protected]
git add Package.swift
git commit -m "Release ${{ github.event.client_payload.tag }}"
git push

- uses: ncipollo/release-action@v1
with:
name: ${{ github.event.client_payload.title }}
tag: ${{ github.event.client_payload.tag }}
body: >
Review the changes made in the
[PowerSync SQLite Core release](https://github.com/${{ github.event.client_payload.repository }}/releases/tag/${{ github.event.client_payload.tag }})
associated with this version.
24 changes: 24 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// swift-tools-version:5.3
import PackageDescription
let packageName = "PowerSyncSQLiteCore"

let package = Package(
name: packageName,
platforms: [
.iOS(.v11),
.macOS(.v10_13)
],
products: [
.library(
name: packageName,
targets: [packageName]
),
],
targets: [
.binaryTarget(
name: packageName,
url: "SHOULD BE UPDATED BY GITHUB ACTION",
checksum: "SHOULD BE UPDATED BY GITHUB ACTION"
)
]
)
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# powersync-sqlite-core-swift
Swift Package Manager version of powersync-sqlite-core
# PowerSync SQLite Core Swift Package

This is the Swift Package Manager version of[powersync-sqlite-core](https://github.com/powersync-ja/powersync-sqlite-core). See CHANGELOG and more information in that repo.