Skip to content

Commit

Permalink
Migrate to GitHub Actions reusable workflows (#97)
Browse files Browse the repository at this point in the history
* Migrate update versions to use reusable workflow

* Migrate build and test to GHA and update Makefile for consistency

Remove local scripts and CircleCI config

* Migrate release workflow to reusable workflow

* Enable codecov

* bundle install with 2.5.23

* Update AEPTestUtils to 5.2.2 (Core)

* Update functional tests to use longer default timeout for network request assertions

* Update Gemfile cocoapods to 1.16.2

* Update file structure to revert back to objectVersion 54
  • Loading branch information
timkimadobe authored Nov 27, 2024
1 parent 08e9e1c commit a6f2850
Show file tree
Hide file tree
Showing 15 changed files with 282 additions and 459 deletions.
127 changes: 0 additions & 127 deletions .circleci/config.yml

This file was deleted.

31 changes: 31 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#
# Copyright 2024 Adobe. All rights reserved.
# This file is licensed to you under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under
# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
# OF ANY KIND, either express or implied. See the License for the specific language
# governing permissions and limitations under the License.
#

name: Build and Test

on:
pull_request:

jobs:
build-and-test:
name: "CI"
uses: adobe/aepsdk-commons/.github/workflows/[email protected]
with:
ios-device-names: '["iPhone 15"]'
ios-versions: '["18.1"]'
tvos-device-names: '["Apple TV"]'
tvos-versions: '["18.1"]'
run-test-ios-unit: true
run-test-ios-functional: true
run-build-xcframework-and-app: true
enable-codecov: true
secrets: inherit
120 changes: 32 additions & 88 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,101 +1,45 @@
#
# Copyright 2024 Adobe. All rights reserved.
# This file is licensed to you under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under
# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
# OF ANY KIND, either express or implied. See the License for the specific language
# governing permissions and limitations under the License.
#

name: Release

on:
workflow_dispatch:
inputs:
tag:
description: 'tag/version'
description: 'The tag (version) to be released (ex: 1.2.3).'
type: string
required: true
default: '1.0.0'

action_tag:
description: 'create tag ("no" to skip)'
create-github-release:
description: 'Create a GitHub release with uploaded artifacts. If the provided `tag` does not exist, it will be created.'
type: boolean
required: true
default: 'yes'
default: true

release_AEPEdgeBridge:
description: 'release AEPEdgeBridge to Cocoapods ("no" to skip)'
pod-publish-extensions:
description: 'Publish AEPEdgeBridge to Cocoapods.'
type: boolean
required: true
default: 'yes'
default: true

jobs:
release_edgebridge:
runs-on: macos-13
steps:
- uses: actions/checkout@v2
with:
ref: main
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15.0.1'

- name: Install jq
run: brew install jq

- name: Install cocoapods
run: gem install cocoapods

- name: Install xcodegen
run: brew install xcodegen

- name: Check version in Podspec
run: |
set -eo pipefail
echo Target version: ${{ github.event.inputs.tag }}
make check-version VERSION=${{ github.event.inputs.tag }}
- name: Pod repo update
run: |
pod repo update
- name: SPM integration test
if: ${{ github.event.inputs.action_tag == 'yes' }}
run: |
set -eo pipefail
echo SPM integration test starts:
make test-SPM-integration
- name: podspec file verification
if: ${{ github.event.inputs.action_tag == 'yes' }}
run: |
set -eo pipefail
echo podspec file verification starts:
make test-podspec
- name: Build Artifacts
if: ${{ github.event.inputs.action_tag == 'yes' }}
run: |
make archive
make zip
- name: Create GH Release
id: create_release
uses: release-drafter/release-drafter@v5
if: ${{ github.event.inputs.action_tag == 'yes' }}
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: Upload - AEPEdgeBridge
uses: actions/upload-release-asset@v1
if: ${{ github.event.inputs.action_tag == 'yes' }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./build/AEPEdgeBridge.xcframework.zip
asset_name: AEPEdgeBridge-${{ github.event.inputs.tag }}.xcframework.zip
asset_content_type: application/zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish Pods - AEPEdgeBridge
if: ${{ github.event.inputs.release_AEPEdgeBridge == 'yes' }}
run: |
set -eo pipefail
pod trunk push AEPEdgeBridge.podspec --allow-warnings --synchronous
pod repo update
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
release:
permissions:
contents: write
uses: adobe/aepsdk-commons/.github/workflows/[email protected]
with:
tag: ${{ github.event.inputs.tag }}
create-github-release: ${{ github.event.inputs.create-github-release == 'true' && 'AEPEdgeBridge' || '' }}
pod-publish-extensions: ${{ github.event.inputs.pod-publish-extensions == 'true' && 'AEPEdgeBridge' || '' }}
version-validation-paths: AEPEdgeBridge.podspec, AEPEdgeBridge.xcodeproj/project.pbxproj, Sources/EdgeBridgeConstants.swift
secrets: inherit
45 changes: 45 additions & 0 deletions .github/workflows/update-versions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#
# Copyright 2024 Adobe. All rights reserved.
# This file is licensed to you under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under
# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
# OF ANY KIND, either express or implied. See the License for the specific language
# governing permissions and limitations under the License.
#

name: Update Versions

on:
workflow_dispatch:
inputs:
version:
description: 'The new version to use for the extension (ex: 1.2.3).'
type: string
required: true

branch:
description: 'The target branch where the version update will be applied and the pull request will be merged into.'
type: string
required: true

core-dependency:
description: 'If a version is provided, update AEPCore dependency in podspec and Package.swift.'
type: string
required: false
default: ''

jobs:
update-versions:
permissions:
contents: write
pull-requests: write
uses: adobe/aepsdk-commons/.github/workflows/[email protected]
with:
version: ${{ github.event.inputs.version }}
branch: ${{ github.event.inputs.branch }}
dependencies: AEPCore ${{ github.event.inputs.core-dependency }}
paths: Package.swift:swift_spm, AEPEdgeBridge.podspec, AEPEdgeBridge.xcodeproj/project.pbxproj, Sources/EdgeBridgeConstants.swift
update: true
47 changes: 0 additions & 47 deletions .github/workflows/update_versions.yml

This file was deleted.

Loading

0 comments on commit a6f2850

Please sign in to comment.