new: add sha256 to github action for ios
This commit is contained in:
6
.github/workflows/release.yml
vendored
6
.github/workflows/release.yml
vendored
@@ -83,7 +83,11 @@ jobs:
|
|||||||
else
|
else
|
||||||
gzip -r -S ".gz" ./bin/hiddify-libcore*
|
gzip -r -S ".gz" ./bin/hiddify-libcore*
|
||||||
fi
|
fi
|
||||||
|
- name: Calculate SHA256 Checksum
|
||||||
|
if: startsWith(matrix.job.target,'ios')
|
||||||
|
run: |
|
||||||
|
sha256sum hiddify-libcore-ios.xcframework.zip > hiddify-libcore-ios.xcframework.zip.sha256
|
||||||
|
working-directory: bin
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v3
|
||||||
if: ${{ success() }}
|
if: ${{ success() }}
|
||||||
with:
|
with:
|
||||||
|
|||||||
8
Makefile
8
Makefile
@@ -28,7 +28,7 @@ ios-full: lib_install
|
|||||||
ios: lib_install
|
ios: lib_install
|
||||||
gomobile bind -v -target ios -libname=box -tags=$(TAGS),with_dhcp,with_low_memory,with_conntrack -trimpath -ldflags="-w -s" -o $(BINDIR)/$(PRODUCT_NAME).xcframework github.com/sagernet/sing-box/experimental/libbox ./mobile &&\
|
gomobile bind -v -target ios -libname=box -tags=$(TAGS),with_dhcp,with_low_memory,with_conntrack -trimpath -ldflags="-w -s" -o $(BINDIR)/$(PRODUCT_NAME).xcframework github.com/sagernet/sing-box/experimental/libbox ./mobile &&\
|
||||||
mv $(BINDIR)/$(PRODUCT_NAME).xcframework $(BINDIR)/$(NAME).xcframework &&\
|
mv $(BINDIR)/$(PRODUCT_NAME).xcframework $(BINDIR)/$(NAME).xcframework &&\
|
||||||
cp Libcore.podspec $(BINDIR)/$(NAME).xcframework/
|
# cp Libcore.podspec $(BINDIR)/$(NAME).xcframework/
|
||||||
cp Info.plist $(BINDIR)/$(NAME).xcframework/
|
cp Info.plist $(BINDIR)/$(NAME).xcframework/
|
||||||
|
|
||||||
|
|
||||||
@@ -61,12 +61,14 @@ release: # Create a new tag for release.
|
|||||||
VERSION_STR="$${VERSION_ARRAY[0]}.$${VERSION_ARRAY[1]}.$${VERSION_ARRAY[2]}" && \
|
VERSION_STR="$${VERSION_ARRAY[0]}.$${VERSION_ARRAY[1]}.$${VERSION_ARRAY[2]}" && \
|
||||||
BUILD_NUMBER=$$(( $${VERSION_ARRAY[0]} * 10000 + $${VERSION_ARRAY[1]} * 100 + $${VERSION_ARRAY[2]} )) && \
|
BUILD_NUMBER=$$(( $${VERSION_ARRAY[0]} * 10000 + $${VERSION_ARRAY[1]} * 100 + $${VERSION_ARRAY[2]} )) && \
|
||||||
echo "version: $${VERSION_STR}+$${BUILD_NUMBER}" && \
|
echo "version: $${VERSION_STR}+$${BUILD_NUMBER}" && \
|
||||||
sed -i "s/^s.version: .*/s.version = '$${VERSION_STR}'/g" Libcore.podspec && \
|
# sed -i "s/^s.version: .*/s.version = '$${VERSION_STR}'/g" Libcore.podspec && \
|
||||||
|
sed -i "s/^let version: .*/let version = \"v$${VERSION_STR}\"/g" Package.swift && \
|
||||||
|
|
||||||
sed -i -e "s|<key>CFBundleVersion</key>\s*<string>[^<]*</string>|<key>CFBundleVersion</key><string>$${VERSION_STR}</string>|" Info.plist &&\
|
sed -i -e "s|<key>CFBundleVersion</key>\s*<string>[^<]*</string>|<key>CFBundleVersion</key><string>$${VERSION_STR}</string>|" Info.plist &&\
|
||||||
sed -i -e "s|<key>CFBundleShortVersionString</key>\s*<string>[^<]*</string>|<key>CFBundleShortVersionString</key><string>$${VERSION_STR}</string>|" Info.plist &&\
|
sed -i -e "s|<key>CFBundleShortVersionString</key>\s*<string>[^<]*</string>|<key>CFBundleShortVersionString</key><string>$${VERSION_STR}</string>|" Info.plist &&\
|
||||||
git tag $${TAG} > /dev/null && \
|
git tag $${TAG} > /dev/null && \
|
||||||
git tag -d $${TAG} > /dev/null && \
|
git tag -d $${TAG} > /dev/null && \
|
||||||
git add Libcore.podspec Info.plist && \
|
git add Package.swift Info.plist && \
|
||||||
git commit -m "release: version $${TAG}" && \
|
git commit -m "release: version $${TAG}" && \
|
||||||
echo "creating git tag : v$${TAG}" && \
|
echo "creating git tag : v$${TAG}" && \
|
||||||
git tag v$${TAG} && \
|
git tag v$${TAG} && \
|
||||||
|
|||||||
@@ -3,24 +3,45 @@
|
|||||||
|
|
||||||
import PackageDescription
|
import PackageDescription
|
||||||
|
|
||||||
let package = Package(
|
func fetchChecksum(from url: String) throws -> String {
|
||||||
name: "Libcore",
|
guard let checksumURL = URL(string: url) else {
|
||||||
platforms: [
|
throw NSError(domain: "Invalid URL", code: 0, userInfo: nil)
|
||||||
.iOS(.v13) // Minimum platform version
|
}
|
||||||
],
|
|
||||||
products: [
|
let checksumString = try String(contentsOf: checksumURL)
|
||||||
.library(
|
return checksumString.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||||
name: "Libcore",
|
}
|
||||||
targets: ["Libcore"]),
|
|
||||||
],
|
let version = "draft"
|
||||||
dependencies: [
|
let baseURL = "https://github.com/hiddify/hiddify-next-core/releases/download/"
|
||||||
// No dependencies
|
let packageURL = "\(baseURL)\(version)/hiddify-libcore-ios.xcframework.zip"
|
||||||
],
|
let checksumURL = "\(packageURL).sha256"
|
||||||
targets: [
|
|
||||||
.binaryTarget(
|
do {
|
||||||
name: "Libcore",
|
let package = Package(
|
||||||
url: "https://github.com/hiddify/hiddify-next-core/releases/download/draft/hiddify-libcore-ios.xcframework.zip",
|
name: "Libcore",
|
||||||
checksum: "70f84a51508898a706e72ab9eda4af8ab72c321bf79284b38313764b8f2091b2"
|
platforms: [
|
||||||
)
|
.iOS(.v13) // Minimum platform version
|
||||||
]
|
],
|
||||||
)
|
products: [
|
||||||
|
.library(
|
||||||
|
name: "Libcore",
|
||||||
|
targets: ["Libcore"]),
|
||||||
|
],
|
||||||
|
dependencies: [
|
||||||
|
// No dependencies
|
||||||
|
],
|
||||||
|
targets: [
|
||||||
|
.binaryTarget(
|
||||||
|
name: "Libcore",
|
||||||
|
url: packageURL,
|
||||||
|
checksum: try fetchChecksum(from: checksumURL)
|
||||||
|
)
|
||||||
|
]
|
||||||
|
)
|
||||||
|
} catch {
|
||||||
|
// Handle URL or checksum fetch errors
|
||||||
|
print("Error: \(error)")
|
||||||
|
// You might want to exit or handle the error in a way suitable for your application
|
||||||
|
// exit(1)
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user