Compare commits

..

No commits in common. "ai/forgejo-capacitor-8-5-2" and "3.4.3" have entirely different histories.

12 changed files with 85 additions and 221 deletions

View file

@ -1,59 +0,0 @@
name: Build and Release
on:
workflow_call:
inputs:
release-version:
required: true
type: string
draft-flag:
type: string
default: " "
secrets:
XCFRAMEWORK_SIGNING_TOKEN:
required: true
jobs:
build:
runs-on: macos-15
timeout-minutes: 30
steps:
- name: Validate release version
run: |
version="${{ inputs.release-version }}"
major="${version%%.*}"
if [[ ! "$major" =~ ^[0-9]+$ ]] || (( major < 6 || major > 8 )); then
echo "::error::Capacitor $version is not supported by this repository. Starting with Capacitor 9 (see https://github.com/ionic-team/capacitor/pull/8588 PR), the iOS platform is a source-first Swift package built directly from the ionic-team/capacitor repository, so SPM distribution no longer happens here. This repository only releases major versions 6, 7, and 8."
exit 1
fi
- run: |
if [[ "${{ inputs.release-version }}" =~ ^[67]\. ]]; then
sudo xcode-select --switch /Applications/Xcode_16.2.app
else
sudo xcode-select --switch /Applications/Xcode_26.0.app
fi
- uses: actions/checkout@v7
- name: Install dependencies
run: brew install ghr
- name: Check Simulators
run: xcrun simctl list > /dev/null
- name: Install Simulators
run: xcodebuild -downloadPlatform iOS
- name: Build Capacitor and Cordova
run: ./build-cap ${{ inputs.release-version }}
- name: Sign Capacitor xcframework
uses: ionic-team/sign-xcframework@main
with:
cert-token: ${{ secrets.XCFRAMEWORK_SIGNING_TOKEN }}
xcframework-path: Capacitor.xcframework
- name: Sign Cordova xcframework
uses: ionic-team/sign-xcframework@main
with:
cert-token: ${{ secrets.XCFRAMEWORK_SIGNING_TOKEN }}
xcframework-path: Cordova.xcframework
- name: Package Capacitor and Cordova
run: ./package-cap ${{ inputs.release-version }}
- name: Push manifest update
uses: EndBug/add-and-commit@v9
- name: Create Release
run: ghr -token ${{ secrets.GITHUB_TOKEN }} -name ${{ inputs.release-version }} ${{ inputs.draft-flag }} -replace ${{ inputs.release-version }} frameworks

View file

@ -1,21 +0,0 @@
name: Dispatch Release
on:
workflow_dispatch:
inputs:
release-version:
description: The version to release
required: true
type: string
draft-flag:
description: "Create a Draft Release or Immediately Release"
type: string
default: " "
jobs:
create-release:
uses: ./.github/workflows/build-and-release.yaml
with:
release-version: ${{ inputs.release-version }}
draft-flag: ${{ inputs.draft-flag }}
secrets: inherit

View file

@ -1,22 +0,0 @@
name: Pre-Release
on:
push:
branches:
- "release/**"
jobs:
release-version:
runs-on: ubuntu-latest
outputs:
release-version: ${{ steps.step1.outputs.release_version }}
steps:
- id: step1
run: echo "release_version=${GITHUB_REF#refs/*/*/}" >> $GITHUB_OUTPUT
create-pre-release:
needs: release-version
uses: ./.github/workflows/build-and-release.yaml
with:
release-version: ${{ needs.release-version.outputs.release-version }}
draft-flag: -draft
secrets: inherit

4
.gitignore vendored
View file

@ -1,6 +1,4 @@
capacitor-checkout
*.xcframework
*.zip
.swiftpm
frameworks
.build

View file

@ -1,11 +0,0 @@
The MIT License (MIT)
Copyright (c) 2022-present Drifty Co.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Third-party components, software, and/or libraries (collectively, "components") are included under the licenses specified by their authors. For information about these third-party licenses, refer to the separate legal notices governing such components at NOTICE file at the top level of the package.

View file

@ -1,4 +0,0 @@
Capacitor/Cordova 8.5.2, unchanged binary artifacts and upstream checksums.
Imported once from Ionic; future builds use only git.kico-dev.de.
Original upstream revision: 0b6882e9a3288342aacf36348e5a94e4f1dd7b13.
Licence and notices are retained from upstream. MeeNow pins this commit.

View file

@ -12,19 +12,19 @@ let package = Package(
.library(
name: "Cordova",
targets: ["Cordova"]
)
),
],
dependencies: [],
targets: [
.binaryTarget(
name: "Capacitor",
url: "https://git.kico-dev.de/martin/capacitor-swift-pm/raw/commit/916218efd53e6e646c36bbfd71e8f06c1b643fbf/artifacts/Capacitor.xcframework.zip",
checksum: "134c65a8bd30bfaa8ccb158d78142fa7231bf3f472e4a5d808c5fbed90fd4c75"
url: "https://github.com/ionic-team/capacitor-swift-pm/releases/download/3.4.3/Capacitor.xcframework.zip",
checksum: "c54a0c7ddb7a887fdb741c933596bc6eb18741f1b17a404f2acc18e78a1094a1"
),
.binaryTarget(
name: "Cordova",
url: "https://git.kico-dev.de/martin/capacitor-swift-pm/raw/commit/916218efd53e6e646c36bbfd71e8f06c1b643fbf/artifacts/Cordova.xcframework.zip",
checksum: "57ff2c8f1e5dcd8d4379ac3cccde1407d81ccd575347dc2aff4f72272b8794a1"
url: "https://github.com/ionic-team/capacitor-swift-pm/releases/download/3.4.3/CapacitorCordova.xcframework.zip",
checksum: "903aae3aa3b36a6c294ab87732aa43ce76fe47dfa3c08b5c958749fa5c706032"
)
]
)

View file

@ -1,5 +0,0 @@
# Swift Package Manager Support for Capacitor
This repo is for hosting binary xcframework releases of Capacitor and CapacitorCordova for SPM support.
Only applies to Capacitor major versions 6, 7, and 8. Starting with Capacitor 9, the iOS platform is a source-first Swift package built directly from the [ionic-team/capacitor](https://github.com/ionic-team/capacitor) repository.

Binary file not shown.

Binary file not shown.

109
build-cap
View file

@ -1,61 +1,96 @@
#!/usr/bin/env bash -eoux pipefail
#!/bin/bash -eoux pipefail
build_simulator() {
local SCHEME=$1
xcodebuild archive \
-scheme $SCHEME \
-workspace Capacitor.xcworkspace \
-destination "generic/platform=iOS Simulator" \
-configuration Debug \
-archivePath ./Build/$SCHEME-iOS-Simulator \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES \
DEBUG_INFORMATION_FORMAT="dwarf-with-dsym"
portals_dev_release_commit() {
git log --oneline | grep -B 1 "Release $1" | head -n1 | sed 's/ /\n/g' | head -n1 | xargs git checkout
}
build_ios() {
local SCHEME=$1
build_capacitor_simulator() {
xcodebuild archive \
-scheme $SCHEME \
-scheme Capacitor \
-workspace Capacitor.xcworkspace \
-destination "generic/platform=iOS Simulator" \
-archivePath ./Build/iOS-Simulator \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES
}
build_capacitor_ios() {
xcodebuild archive \
-scheme Capacitor \
-workspace Capacitor.xcworkspace \
-destination "generic/platform=iOS" \
-archivePath ./Build/$SCHEME-iOS \
-archivePath ./Build/iOS \
SKIP_INSTALL=NO \
SWIFT_SERIALIZE_DEBUGGING_OPTIONS=NO \
DEBUG_INFORMATION_FORMAT="dwarf-with-dsym" \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES
}
create_xcframeworks() {
build_simulator Capacitor
build_simulator Cordova
build_ios Capacitor
build_ios Cordova
rm -rf ./Build/Capacitor-iOS-Simulator.xcarchive/Products/Library/Frameworks/Capacitor.framework/Frameworks
rm -rf ./Build/Capacitor-iOS.xcarchive/Products/Library/Frameworks/Capacitor.framework/Frameworks
build_capacitor_simulator
build_capacitor_ios
xcodebuild -create-xcframework \
-framework ./Build/Capacitor-iOS-Simulator.xcarchive/Products/Library/Frameworks/Capacitor.framework \
-debug-symbols $PWD/Build/Capacitor-iOS-Simulator.xcarchive/dSYMs/Capacitor.framework.dSYM \
-framework ./Build/Capacitor-iOS.xcarchive/Products/Library/Frameworks/Capacitor.framework \
-debug-symbols $PWD/Build/Capacitor-iOS.xcarchive/dSYMs/Capacitor.framework.dSYM \
-framework ./Build/iOS-Simulator.xcarchive/Products/Library/Frameworks/Capacitor.framework \
-framework ./Build/iOS.xcarchive/Products/Library/Frameworks/Capacitor.framework \
-output Capacitor.xcframework
xcodebuild -create-xcframework \
-framework ./Build/Cordova-iOS-Simulator.xcarchive/Products/Library/Frameworks/Cordova.framework \
-debug-symbols $PWD/Build/Cordova-iOS-Simulator.xcarchive/dSYMs/Cordova.framework.dSYM \
-framework ./Build/Cordova-iOS.xcarchive/Products/Library/Frameworks/Cordova.framework \
-debug-symbols $PWD/Build/Cordova-iOS.xcarchive/dSYMs/Cordova.framework.dSYM \
-framework ./Build/iOS-Simulator.xcarchive/Products/Library/Frameworks/Cordova.framework \
-framework ./Build/iOS.xcarchive/Products/Library/Frameworks/Cordova.framework \
-output Cordova.xcframework
zip -r Capacitor.xcframework.zip Capacitor.xcframework
zip -r Cordova.xcframework.zip Cordova.xcframework
}
write_package_file() {
cat << EOF > Package.swift
// swift-tools-version:5.3
import PackageDescription
let package = Package(
name: "capacitor-swift-pm",
products: [
.library(
name: "Capacitor",
targets: ["Capacitor"]
),
.library(
name: "Cordova",
targets: ["Cordova"]
),
],
dependencies: [],
targets: [
.binaryTarget(
name: "Capacitor",
url: "$1",
checksum: "$2"
),
.binaryTarget(
name: "Cordova",
url: "$3",
checksum: "$4"
)
]
)
EOF
}
git clone https://github.com/ionic-team/capacitor capacitor-checkout
cd capacitor-checkout/ios/Capacitor
git checkout $1
git checkout portals-dev
#portals_dev_release_commit $1
create_xcframeworks
mv Capacitor.xcframework ../../../
mv Cordova.xcframework ../../../
cap_url="https://github.com/ionic-team/capacitor-swift-pm/releases/download/$1/Capacitor.xcframework.zip"
cap_sha=$(sha256sum Capacitor.xcframework.zip | sed 's/ /\n/g' | head -n1 | xargs echo -n)
cap_cordova_url="https://github.com/ionic-team/capacitor-swift-pm/releases/download/$1/CapacitorCordova.xcframework.zip"
cap_cordova_sha=$(sha256sum Cordova.xcframework.zip | sed 's/ /\n/g' | head -n1 | xargs echo -n)
cd ../../../
write_package_file $cap_url $cap_sha $cap_cordova_url $cap_cordova_sha

View file

@ -1,47 +0,0 @@
#!/usr/bin/env bash -eoux pipefail
mkdir frameworks
zip -r frameworks/Capacitor.xcframework.zip Capacitor.xcframework
zip -r frameworks/Cordova.xcframework.zip Cordova.xcframework
write_package_file() {
cat <<EOF >Package.swift
// swift-tools-version:5.3
import PackageDescription
let package = Package(
name: "capacitor-swift-pm",
products: [
.library(
name: "Capacitor",
targets: ["Capacitor"]
),
.library(
name: "Cordova",
targets: ["Cordova"]
)
],
dependencies: [],
targets: [
.binaryTarget(
name: "Capacitor",
url: "$1",
checksum: "$2"
),
.binaryTarget(
name: "Cordova",
url: "$3",
checksum: "$4"
)
]
)
EOF
}
cap_url="https://github.com/ionic-team/capacitor-swift-pm/releases/download/$1/Capacitor.xcframework.zip"
cap_sha=$(shasum -a 256 frameworks/Capacitor.xcframework.zip | sed 's/ /\n/g' | head -n1 | xargs echo -n)
cap_cordova_url="https://github.com/ionic-team/capacitor-swift-pm/releases/download/$1/Cordova.xcframework.zip"
cap_cordova_sha=$(shasum -a 256 frameworks/Cordova.xcframework.zip | sed 's/ /\n/g' | head -n1 | xargs echo -n)
write_package_file $cap_url $cap_sha $cap_cordova_url $cap_cordova_sha