Skip to content

Commit

Permalink
Migrate release workflow to reusable workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
timkimadobe committed Nov 21, 2024
1 parent 01d1f66 commit ba2b53e
Showing 1 changed file with 32 additions and 88 deletions.
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

0 comments on commit ba2b53e

Please sign in to comment.