Skip to content

Commit

Permalink
Merge pull request #63 from adobe/dev
Browse files Browse the repository at this point in the history
`dev` -> `staging` [NON-RELEASE] Migrate to GitHub Actions reusable workflows
  • Loading branch information
timkimadobe authored Dec 5, 2024
2 parents af15c04 + f26c8a6 commit 2d1bcfa
Show file tree
Hide file tree
Showing 15 changed files with 295 additions and 389 deletions.
164 changes: 0 additions & 164 deletions .circleci/config.yml

This file was deleted.

35 changes: 35 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#
# 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-test-ios-integration: true
run-test-tvos-unit: true
run-test-tvos-functional: true
run-test-tvos-integration: true
run-build-xcframework-and-app: true
enable-codecov: true
secrets: inherit
117 changes: 32 additions & 85 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,97 +1,44 @@
#
# 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_AEPEdgeMedia:
description: 'release AEPEdgeMedia to Cocoapods ("no" to skip)'
pod-publish-extensions:
description: 'Publish AEPEdgeMedia to Cocoapods.'
type: boolean
required: true
default: 'yes'

default: true
jobs:
release_edgemedia:
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: 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 - AEPEdgeMedia
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/AEPEdgeMedia.xcframework.zip
asset_name: AEPEdgeMedia-${{ github.event.inputs.tag }}.xcframework.zip
asset_content_type: application/zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish Pods - AEPEdgeMedia
if: ${{ github.event.inputs.release_AEPEdgeMedia == 'yes' }}
run: |
set -eo pipefail
pod trunk push AEPEdgeMedia.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' && 'AEPEdgeMedia' || '' }}
pod-publish-extensions: ${{ github.event.inputs.pod-publish-extensions == 'true' && 'AEPEdgeMedia' || '' }}
version-validation-paths: AEPEdgeMedia.podspec, AEPEdgeMedia.xcodeproj/project.pbxproj, Sources/MediaConstants.swift
secrets: inherit
51 changes: 51 additions & 0 deletions .github/workflows/update-versions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#
# 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: ''

edge-dependency:
description: 'If a version is provided, update AEPEdge 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 }}, AEPEdge ${{ github.event.inputs.edge-dependency }}
paths: Package.swift:swift_spm, AEPEdgeMedia.podspec, AEPEdgeMedia.xcodeproj/project.pbxproj, Sources/MediaConstants.swift
update: true
Loading

0 comments on commit 2d1bcfa

Please sign in to comment.