Skip to content

Commit

Permalink
fixed CI logic (publish pod after full release) (#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
ypopovych authored Dec 19, 2024
1 parent febdab3 commit 61dfc6e
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 7 deletions.
1 change: 0 additions & 1 deletion .github/workflows/createRelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ jobs:
- name: Build and upload XCFrameworks, recreate tag
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
run: make XC_LOG=archive version=${{ github.event.inputs.version }} github_release
- name: Attach Xcode logs
if: '!cancelled()'
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/publishPod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Publish to CocoaPods

on:
release:
types: [published]

permissions:
contents: read

jobs:
publish-pod:
name: Publish Pod
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Publish
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
run: make publish_pod
2 changes: 1 addition & 1 deletion DatadogSDKTesting.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1448,7 +1448,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/bash;
shellScript = "FRAMEWORKS_DIR=\"${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}\"\nmkdir -p \"${FRAMEWORKS_DIR}\"\ncp -rf \"${BUILT_PRODUCTS_DIR}/CodeCoverage.framework\" \"${FRAMEWORKS_DIR}/\"\n";
shellScript = "FRAMEWORKS_DIR=\"${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}\"\nmkdir -p \"${FRAMEWORKS_DIR}\"\ncp -af \"${BUILT_PRODUCTS_DIR}/CodeCoverage.framework\" \"${FRAMEWORKS_DIR}/\"\n";
};
/* End PBXShellScriptBuildPhase section */

Expand Down
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ release:

github_release: release
@:$(call check_defined, GH_TOKEN, GitHub token)
@:$(call check_defined, COCOAPODS_TRUNK_TOKEN, CocoaPods trunk token)
# Upload binary file to GitHub release
# Update gh utility if needed
brew list gh &>/dev/null || brew install gh
# Commit updated xcodeproj and Package.swift
@git add Package.swift DatadogSDKTesting.podspec DatadogSDKTesting.xcodeproj/project.pbxproj
Expand All @@ -99,8 +98,10 @@ github_release: release
# make github release
@gh release create $(version) --draft --verify-tag --generate-notes \
build/xcframework/DatadogSDKTesting.zip build/symbols/DatadogSDKTesting.symbols.zip
# Push Podfile
pod trunk push --allow-warnings DatadogSDKTesting.podspec

publish_pod:
@:$(call check_defined, COCOAPODS_TRUNK_TOKEN, CocoaPods trunk token)
@pod trunk push --allow-warnings DatadogSDKTesting.podspec

clean:
rm -rf ./build
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ let url = "https://github.com/DataDog/dd-sdk-swift-testing/releases/download/\(r

let package = Package(
name: "dd-sdk-swift-testing",
platforms: [.macOS(.v10_13), .iOS(.v11), .tvOS(.v11)],
platforms: [.macOS(.v10_13), .macCatalyst(.v13), .iOS(.v11), .tvOS(.v11)],
products: [
.library(name: "DatadogSDKTesting",
targets: ["DatadogSDKTesting"]),
Expand Down

0 comments on commit 61dfc6e

Please sign in to comment.