Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "release action" to AEPCore repo; bump up version to 3.0.0-beta3 #500

Merged
merged 2 commits into from
Jan 14, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 102 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Release


on:
workflow_dispatch:
inputs:
tag:
description: 'tag/version'
required: true
default: '1.0.0'

jobs:
release_rules_engine:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
with:
ref: main

- name: Install jq
run: brew install jq

- name: Check version in Podspec
run: |
set -eo pipefail
echo Target version: ${{ github.event.inputs.tag }}
make check-version VERSION=${{ github.event.inputs.tag }}
# "release-drafter" action docs -> https://github.com/marketplace/actions/release-drafter
- name: SPM integration test
run: |
set -eo pipefail
echo SPM integration test starts:
make test-SPM-integration
- name: podspec file verification
run: |
set -eo pipefail
echo podspec file verification starts:
make test-podspec
- uses: release-drafter/release-drafter@v5
with:
name: v${{ github.event.inputs.tag }}
tag: ${{ github.event.inputs.tag }}
version: ${{ github.event.inputs.tag }}
publish: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish Pods - AEPService
run: |
set -eo pipefail
gem install cocoapods
pod lib lint AEPServices.podspec --allow-warnings --swift-version=5.1
pod trunk push AEPServices.podspec --allow-warnings
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}

- name: Sleep for 3 seconds
uses: jakejarvis/wait-action@master
with:
time: '3s'

- name: Publish Pods - AEPCore
run: |
set -eo pipefail
gem install cocoapods
pod lib lint AEPCore.podspec --allow-warnings --swift-version=5.1
pod trunk push AEPCore.podspec --allow-warnings
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}

- name: Sleep for 3 seconds
uses: jakejarvis/wait-action@master
with:
time: '3s'

- name: Publish Pods - AEPIdentity
run: |
set -eo pipefail
gem install cocoapods
pod lib lint AEPIdentity.podspec --allow-warnings --swift-version=5.1
pod trunk push AEPIdentity.podspec --allow-warnings
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}

- name: Publish Pods - AEPLifecycle
run: |
set -eo pipefail
gem install cocoapods
pod lib lint AEPLifecycle.podspec --allow-warnings --swift-version=5.1
pod trunk push AEPLifecycle.podspec --allow-warnings
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}

- name: Publish Pods - AEPSignal
run: |
set -eo pipefail
gem install cocoapods
pod lib lint AEPSignal.podspec --allow-warnings --swift-version=5.1
pod trunk push AEPSignal.podspec --allow-warnings
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}

2 changes: 1 addition & 1 deletion AEPCore.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "AEPCore"
s.version = "3.0.0-beta.2"
s.version = "3.0.0-beta.3"
s.summary = "Core library for Adobe Experience Platform Mobile SDK. Written and maintained by Adobe."
s.description = <<-DESC
The core library provides the foundation for the Adobe Experience Platform SDK. Having the core library installed is a pre-requisite for any other Adobe Experience Platform SDK extension to work.
Expand Down
2 changes: 1 addition & 1 deletion AEPCore/Sources/configuration/ConfigurationConstants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import Foundation
struct ConfigurationConstants {
static let EXTENSION_NAME = "com.adobe.module.configuration"
static let FRIENDLY_NAME = "Configuration"
static let EXTENSION_VERSION = "3.0.0-beta.2"
static let EXTENSION_VERSION = "3.0.0-beta.3"
static let DATA_STORE_NAME = EXTENSION_NAME

static let CONFIG_URL_BASE = "https://assets.adobedtm.com/"
Expand Down
2 changes: 1 addition & 1 deletion AEPCore/Sources/core/CoreConstants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import Foundation

enum CoreConstants {
static let EXTENSION_NAME = "com.adobe.module.configuration"
static let EXTENSION_VERSION = "3.0.0-beta.2"
static let EXTENSION_VERSION = "3.0.0-beta.3"
static let DATA_STORE_NAME = EXTENSION_NAME

static let CONFIG_URL_BASE = "https://assets.adobedtm.com/"
Expand Down
2 changes: 1 addition & 1 deletion AEPCore/Sources/eventhub/EventHubConstants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ enum EventHubConstants {
static let STATE_CHANGE = "STATE_CHANGE_EVENT"
static let NAME = "com.adobe.module.eventhub"
static let FRIENDLY_NAME = "EventHub"
static let VERSION_NUMBER = "3.0.0-beta.2"
static let VERSION_NUMBER = "3.0.0-beta.3"

enum EventDataKeys {
static let VERSION = "version"
Expand Down
4 changes: 2 additions & 2 deletions AEPCore/Tests/MobileCoreTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class MobileCoreTests: XCTestCase {
"version" : "0.0.1"
},
"Configuration" : {
"version" : "3.0.0-beta.2"
"version" : "3.0.0-beta.3"
},
"mockExtensionTwo" : {
"metadata" : {
Expand All @@ -201,7 +201,7 @@ class MobileCoreTests: XCTestCase {
"version" : "0.0.1"
}
},
"version" : "3.0.0-beta.2"
"version" : "3.0.0-beta.3"
}
"""
let expectedDict = jsonStrToDict(jsonStr: expected)
Expand Down
2 changes: 1 addition & 1 deletion AEPIdentity.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "AEPIdentity"
s.version = "3.0.0-beta.2"
s.version = "3.0.0-beta.3"
s.summary = "Identity extension for Adobe Experience Platform Mobile SDK. Written and maintained by Adobe."
s.description = <<-DESC
The AEPIdentity extension provides APIs that allow use of the Visitor ID services in the Adobe Experience Cloud SDK.
Expand Down
2 changes: 1 addition & 1 deletion AEPIdentity/Sources/IdentityConstants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import Foundation
enum IdentityConstants {
static let EXTENSION_NAME = "com.adobe.module.identity"
static let FRIENDLY_NAME = "Identity"
static let EXTENSION_VERSION = "3.0.0-beta.2"
static let EXTENSION_VERSION = "3.0.0-beta.3"
static let DATASTORE_NAME = EXTENSION_NAME

static let API_TIMEOUT = TimeInterval(0.5) // Get API requests timeout after half a second
Expand Down
2 changes: 1 addition & 1 deletion AEPLifecycle.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "AEPLifecycle"
s.version = "3.0.0-beta.2"
s.version = "3.0.0-beta.3"
s.summary = "Lifecycle extension for Adobe Experience Platform Mobile SDK. Written and maintained by Adobe."
s.description = <<-DESC
The AEPLifecycle extension is used to track application lifecycle including session metricss and device related data.
Expand Down
2 changes: 1 addition & 1 deletion AEPLifecycle/Sources/LifecycleConstants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import Foundation
enum LifecycleConstants {
static let EXTENSION_NAME = "com.adobe.module.lifecycle"
static let FRIENDLY_NAME = "Lifecycle"
static let EXTENSION_VERSION = "3.0.0-beta.2"
static let EXTENSION_VERSION = "3.0.0-beta.3"
static let DATA_STORE_NAME = LifecycleConstants.EXTENSION_NAME

static let START = "start"
Expand Down
2 changes: 1 addition & 1 deletion AEPServices.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "AEPServices"
s.version = "3.0.0-beta.2"
s.version = "3.0.0-beta.3"
s.summary = "Servcies library for Adobe Experience Platform Mobile SDK. Written and maintained by Adobe."
s.description = <<-DESC
The AEPServices library provides the platform services and utilities for the Adobe Experience Platform SDK. Having the services library installed is a pre-requisite for any other Adobe Experience Platform SDK extension to work.
Expand Down
2 changes: 1 addition & 1 deletion AEPSignal.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "AEPSignal"
s.version = "3.0.0-beta.2"
s.version = "3.0.0-beta.3"
s.summary = "Signal extension for Adobe Experience Platform Mobile SDK. Written and maintained by Adobe."
s.description = <<-DESC
The AEPSignal extension provides the support for Postback/PII/Open URL actions triggered by Core rules engine.
Expand Down
2 changes: 1 addition & 1 deletion AEPSignal/Sources/SignalConstants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import Foundation
enum SignalConstants {
static let EXTENSION_NAME = "com.adobe.module.signal"
static let FRIENDLY_NAME = "Signal"
static let EXTENSION_VERSION = "3.0.0-beta.2"
static let EXTENSION_VERSION = "3.0.0-beta.3"
static let DATASTORE_NAME = EXTENSION_NAME
static let LOG_PREFIX = FRIENDLY_NAME

Expand Down
48 changes: 46 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ AEPINTEGRATION_TEST_TARGET_NAME = AEPIntegrationTests
SIMULATOR_ARCHIVE_PATH = ./build/ios_simulator.xcarchive/Products/Library/Frameworks/
IOS_ARCHIVE_PATH = ./build/ios.xcarchive/Products/Library/Frameworks/

# targets
NC='\033[0m'
RED='\033[0;31m'
GREEN='\033[0;32m'
BLUE='\033[0;34m'

# Targets - test

aep-core-unit-test:
@echo "######################################################################"
@echo "### Unit Testing AEPCore"
Expand Down Expand Up @@ -45,6 +51,8 @@ integration-test:
@echo "######################################################################"
xcodebuild test -workspace $(PROJECT_NAME).xcworkspace -scheme $(AEPINTEGRATION_TEST_TARGET_NAME) -destination 'platform=iOS Simulator,name=iPhone 8' -derivedDataPath build/out -enableCodeCoverage YES

# Targets - archive

archive:
xcodebuild archive -workspace AEPCore.xcworkspace -scheme AEP-All -archivePath "./build/ios.xcarchive" -sdk iphoneos -destination="iOS" SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES
xcodebuild archive -workspace AEPCore.xcworkspace -scheme AEP-All -archivePath "./build/ios_simulator.xcarchive" -sdk iphonesimulator -destination="iOS Simulator" SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES
Expand All @@ -55,6 +63,8 @@ archive:
xcodebuild -create-xcframework -framework $(SIMULATOR_ARCHIVE_PATH)$(AEPSIGNAL_TARGET_NAME).framework -framework $(IOS_ARCHIVE_PATH)$(AEPSIGNAL_TARGET_NAME).framework -output ./build/$(AEPSIGNAL_TARGET_NAME).xcframework
xcodebuild -create-xcframework -framework $(SIMULATOR_ARCHIVE_PATH)AEPRulesEngine.framework -framework $(IOS_ARCHIVE_PATH)AEPRulesEngine.framework -output ./build/AEPRulesEngine.xcframework

# Targets - CI steps

clean:
rm -rf ./build

Expand All @@ -70,8 +80,42 @@ lint:
checkFormat:
swiftformat . --lint --swiftversion 5.1


loc:
# use the following brew command to install cloc
# brew install cloc
cloc AEPSignal/Sources AEPIdentity/Sources AEPLifecycle/Sources AEPCore/Sources AEPServices/Sources

latest-version:
(which jq)
(echo "AEPServices - " && pod spec cat AEPServices | jq '.version' | tr -d '"')
(echo "AEPCore - " && pod spec cat AEPCore | jq '.version' | tr -d '"')
(echo "AEPIdentity - " && pod spec cat AEPIdentity | jq '.version' | tr -d '"')
(echo "AEPLifecycle - " && pod spec cat AEPLifecycle | jq '.version' | tr -d '"')
(echo "AEPSignal - " && pod spec cat AEPSignal | jq '.version' | tr -d '"')

version-podspec-local:
(which jq)
(echo "AEPServices - ${BLUE}$(shell pod ipc spec AEPServices.podspec | jq '.version' | tr -d '"')${NC}")
(echo "AEPCore - ${BLUE}$(shell pod ipc spec AEPCore.podspec | jq '.version' | tr -d '"')${NC}")
(echo "AEPIdentity - ${BLUE}$(shell pod ipc spec AEPIdentity.podspec | jq '.version' | tr -d '"')${NC}")
(echo "AEPLifecycle - ${BLUE}$(shell pod ipc spec AEPLifecycle.podspec | jq '.version' | tr -d '"')${NC}")
(echo "AEPSignal - ${BLUE}$(shell pod ipc spec AEPSignal.podspec | jq '.version' | tr -d '"')${NC}")

version-source-code:
(echo "AEPCore - ${BLUE}$(shell cat ./AEPCore/Sources/core/CoreConstants.swift | egrep '\s*EXTENSION_VERSION\s*=\s*\"(.*)\"' | ruby -e "puts gets.scan(/\"(.*)\"/)[0] " | tr -d '"')${NC}")
(echo "AEPIdentity - ${BLUE}$(shell cat ./AEPIdentity/Sources/IdentityConstants.swift | egrep '\s*EXTENSION_VERSION\s*=\s*\"(.*)\"' | ruby -e "puts gets.scan(/\"(.*)\"/)[0] " | tr -d '"')${NC}")
(echo "AEPLifecycle - ${BLUE}$(shell cat ./AEPLifecycle/Sources/LifecycleConstants.swift | egrep '\s*EXTENSION_VERSION\s*=\s*\"(.*)\"' | ruby -e "puts gets.scan(/\"(.*)\"/)[0] " | tr -d '"')${NC}")
(echo "AEPSignal - ${BLUE}$(shell cat ./AEPSignal/Sources/SignalConstants.swift | egrep '\s*EXTENSION_VERSION\s*=\s*\"(.*)\"' | ruby -e "puts gets.scan(/\"(.*)\"/)[0] " | tr -d '"')${NC}")

# make check-version VERSION=3.0.0-beta.3
check-version:
(sh ./script/version.sh $(VERSION))

test-SPM-integration:
(sh ./script/test-SPM.sh)

test-podspec:
(sh ./script/test-podspec.sh)

pod-lint:
(pod lib lint --allow-warnings --verbose --swift-version=5.1)
68 changes: 68 additions & 0 deletions Script/test-SPM.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#!/bin/bash

set -e # Any subsequent(*) commands which fail will cause the shell script to exit immediately

PROJECT_NAME=TestProject

# Clean up.
rm -rf $PROJECT_NAME

mkdir -p $PROJECT_NAME && cd $PROJECT_NAME

# Create the package.
swift package init

# Create the Package.swift.
echo "// swift-tools-version:5.3
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: \"TestProject\",
defaultLocalization: \"en-US\",
platforms: [
.iOS(.v10)
],
products: [
.library(
name: \"TestProject\",
targets: [\"TestProject\"]
)
],
dependencies: [
.package(name: \"AEPCore\", path: \"../\"),
],
targets: [
.target(
name: \"TestProject\",
dependencies: [
.product(name: \"AEPCore\", package: \"AEPCore\"),
.product(name: \"AEPIdentity\", package: \"AEPCore\"),
.product(name: \"AEPLifecycle\", package: \"AEPCore\"),
.product(name: \"AEPServices\", package: \"AEPCore\"),
.product(name: \"AEPSignal\", package: \"AEPCore\"),
])
]
)
" >Package.swift

swift package update

# Archive for generic iOS device
echo '############# Archive for generic iOS device ###############'
xcodebuild archive -scheme TestProject -destination 'generic/platform=iOS'

# Build for generic iOS device
echo '############# Build for generic iOS device ###############'
xcodebuild build -scheme TestProject -destination 'generic/platform=iOS'

# Build for i386 simulator
echo '############# Build for i386 simulator ###############'
xcodebuild build -scheme TestProject -destination 'generic/platform=iOS Simulator' ARCHS=i386

# Build for x86_64 simulator
echo '############# Build for x86_64 simulator ###############'
xcodebuild build -scheme TestProject -destination 'generic/platform=iOS Simulator' ARCHS=x86_64

# Clean up.
cd ../
rm -rf $PROJECT_NAME
Loading