Skip to content

Commit

Permalink
chore(ci): Trigger SPM release on tag (#7397)
Browse files Browse the repository at this point in the history
Co-authored-by: Dan Giralté <97970732+giralte-ionic@users.noreply.github.com>
  • Loading branch information
Steven0351 and giralte-ionic committed Apr 15, 2024
1 parent e63a881 commit d2b5270
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/publish-spm-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Publish SPM Release

on:
push:
tags:
- "*"

jobs:
publish-spm:
runs-on: ubuntu-latest
steps:
- name: Assign Tag Number to RELEASE_VERSION environment variable
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Dispatch Release Workflow on ionic-team/capacitor-swift-pm
run: gh workflow run dispatch-release.yaml -f release-version=${{ env.RELEASE_VERSION }} --repo ionic-team/capacitor-swift-pm
env:
GITHUB_TOKEN: ${{ secrets.CAPICTOR_PUBLISH_XCFRAMEWORK }}
6 changes: 3 additions & 3 deletions cli/src/util/spm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ let package = Package(
targets: ["CapApp-SPM"])
],
dependencies: [
.package(url: "https://github.com/ionic-team/capacitor-spm.git", branch: "main")`;
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", branch: "main")`;

for (const plugin of plugins) {
const relPath = relative(config.ios.nativeXcodeProjDirAbs, plugin.rootPath);
Expand All @@ -72,8 +72,8 @@ let package = Package(
.target(
name: "CapApp-SPM",
dependencies: [
.product(name: "Capacitor", package: "capacitor-spm"),
.product(name: "Cordova", package: "capacitor-spm")`;
.product(name: "Capacitor", package: "capacitor-swift-pm"),
.product(name: "Cordova", package: "capacitor-swift-pm")`;

for (const plugin of plugins) {
packageSwiftText += `,\n .product(name: "${plugin.ios?.name}", package: "${plugin.ios?.name}")`;
Expand Down
6 changes: 3 additions & 3 deletions ios-spm-template/App/CapApp-SPM/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ let package = Package(
targets: ["CapApp-SPM"])
],
dependencies: [
.package(url: "https://github.com/ionic-team/capacitor-spm.git", branch: "main")
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", branch: "main")
],
targets: [
.target(
name: "CapApp-SPM",
dependencies: [
.product(name: "Capacitor", package: "capacitor-spm"),
.product(name: "Cordova", package: "capacitor-spm")
.product(name: "Capacitor", package: "capacitor-swift-pm"),
.product(name: "Cordova", package: "capacitor-swift-pm")
]
)
]
Expand Down

0 comments on commit d2b5270

Please sign in to comment.