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

Migrate to GitHub Actions reusable workflows #134

Merged
merged 9 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
160 changes: 0 additions & 160 deletions .circleci/config.yml

This file was deleted.

33 changes: 33 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#
# 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-tvos-unit: true
run-test-tvos-functional: true
run-build-xcframework-and-app: true
enable-codecov: true
secrets: inherit
36 changes: 0 additions & 36 deletions .github/workflows/draft-release.yml

This file was deleted.

117 changes: 32 additions & 85 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,98 +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_AEPEdgeIdentity:
description: 'release AEPEdgeIdentity to Cocoapods ("no" to skip)'
pod-publish-extensions:
description: 'Publish AEPEdgeIdentity to Cocoapods.'
type: boolean
required: true
default: 'yes'
default: true

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


- name: Publish Pods - AEPEdgeIdentity
if: ${{ github.event.inputs.release_AEPEdgeIdentity == 'yes' }}
run: |
set -eo pipefail
pod trunk push AEPEdgeIdentity.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' && 'AEPEdgeIdentity' || '' }}
pod-publish-extensions: ${{ github.event.inputs.pod-publish-extensions == 'true' && 'AEPEdgeIdentity' || '' }}
version-validation-paths: AEPEdgeIdentity.podspec, AEPEdgeIdentity.xcodeproj/project.pbxproj, Sources/IdentityConstants.swift
secrets: inherit
Loading