Skip to content

Commit ed7d5ff

Browse files
committed
chore: pre release 1.3.2
1 parent 40e80e0 commit ed7d5ff

File tree

4 files changed

+91
-13
lines changed

4 files changed

+91
-13
lines changed

.github/workflows/pre-release.yaml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Pre-release Build and Publish
2+
3+
on:
4+
push:
5+
tags:
6+
- '*-pre-release'
7+
8+
jobs:
9+
build-and-release:
10+
runs-on: macos-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
token: ${{ secrets.GITHUB_TOKEN }}
18+
19+
- name: Extract version from tag
20+
id: get_version
21+
run: |
22+
TAG_NAME=${GITHUB_REF#refs/tags/}
23+
VERSION=${TAG_NAME%-pre-release}
24+
echo "version=$VERSION" >> $GITHUB_OUTPUT
25+
26+
- name: Build Swift FFI
27+
run: |
28+
chmod +x scripts/build_swift_ffi.sh
29+
./scripts/build_swift_ffi.sh
30+
31+
- name: Calculate SHA256
32+
id: sha256
33+
run: |
34+
CHECKSUM=$(openssl dgst -sha256 loroFFI.xcframework.zip | awk '{print $2}')
35+
echo "checksum=$CHECKSUM" >> $GITHUB_OUTPUT
36+
37+
- name: Update Package.swift
38+
run: |
39+
VERSION=${{ steps.get_version.outputs.version }}
40+
CHECKSUM=${{ steps.sha256.outputs.checksum }}
41+
sed -i '' \
42+
-e "s|url: \"https://github.com/.*/loroFFI.xcframework.zip\"|url: \"https://github.com/${GITHUB_REPOSITORY}/releases/download/${VERSION}/loroFFI.xcframework.zip\"|" \
43+
-e "s|checksum: \"[a-f0-9]*\"|checksum: \"${CHECKSUM}\"|" \
44+
Package.swift
45+
46+
- name: Update README.md
47+
run: |
48+
VERSION=${{ steps.get_version.outputs.version }}
49+
sed -i '' \
50+
-e "s|\"https://github.com/loro-dev/loro-swift.git\", from: \"[0-9.]*\"|\"https://github.com/loro-dev/loro-swift.git\", from: \"${VERSION}\"|" \
51+
README.md
52+
53+
- name: Commit and push changes
54+
run: |
55+
VERSION=${{ steps.get_version.outputs.version }}
56+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
57+
git config --local user.name "github-actions[bot]"
58+
git add Package.swift README.md
59+
git commit -m "chore: update version to ${VERSION}"
60+
git tag -a "${VERSION}" -m "Release version ${VERSION}"
61+
git push origin HEAD:main
62+
git push origin "${VERSION}"
63+
64+
- name: Create Release
65+
uses: softprops/action-gh-release@v1
66+
with:
67+
tag_name: ${{ steps.get_version.outputs.version }}
68+
name: Release ${{ steps.get_version.outputs.version }}
69+
files: loroFFI.xcframework.zip
70+
draft: false
71+
prerelease: false
72+
env:
73+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
74+
75+
- name: Delete pre-release tag
76+
run: |
77+
VERSION=${{ steps.get_version.outputs.version }}
78+
git push origin :refs/tags/${VERSION}-pre-release

loro-rs/Cargo.lock

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

loro-rs/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "loro-swift"
3-
version = "1.3.1"
3+
version = "1.3.2"
44
edition = "2021"
55

66
[lib]
@@ -14,7 +14,7 @@ path = "src/uniffi-bindgen.rs"
1414

1515

1616
[dependencies]
17-
loro-ffi = { git = "https://github.com/loro-dev/loro.git", tag = "[email protected]" }
17+
loro-ffi = { git = "https://github.com/loro-dev/loro.git", tag = "[email protected].patch-1" }
1818
# loro-ffi = { path = "../../loro/crates/loro-ffi" }
1919
uniffi = { version = "0.28.3" }
2020

scripts/update_version.sh

Whitespace-only changes.

0 commit comments

Comments
 (0)