-
Notifications
You must be signed in to change notification settings - Fork 11
Swift GitHub Actions Guidelines
Martin Makarský edited this page May 12, 2021
·
1 revision
Once the release is triggered, dependencies are installed, then the project is built, tested and a new version is released to Cocoapods.
- It is recommended to run builds for Swift/Apple platforms on a macOS machine -
jobs.<name>.runs-on
property. - Target platforms are specified in
strategy.matrix.destination
property. - Manual steps for the releasing of the new version - https://github.com/Kentico/kontent-delivery-sdk-swift#releasing-a-new-version-of-the-cocoapod-package
- Before building, the Cocoapods package manager is installed, repo (trunk mirror) is updated and dependencies are installed.
gem install cocoapods
pod repo update
pod install --project-directory=Example
set -o pipefail && xcodebuild test -enableCodeCoverage YES -workspace Example/KenticoKontentDelivery.xcworkspace -scheme KenticoKontentDelivery-Example -sdk iphonesimulator -destination 'name=iPhone 11' ONLY_ACTIVE_ARCH=NO | xcpretty
- Built dependency pod is pushed to the Cocoapod trunk.
pod trunk push
on:
release:
types: [published]
name: publish-to-cocoapods
jobs:
publish-to-cocoapods:
name: publish-to-cocoapods
runs-on: macOS-latest
strategy:
matrix:
destination: ['platform=iOS Simulator,OS=12.2,name=iPhone 11']
steps:
- name: Checkout
uses: actions/checkout@master
- name: Build and test
run: |
gem install cocoapods
pod repo update
pod install --project-directory=Example
set -o pipefail && xcodebuild test -enableCodeCoverage YES -workspace Example/KenticoKontentDelivery.xcworkspace -scheme KenticoKontentDelivery-Example -sdk iphonesimulator -destination 'name=iPhone 11' ONLY_ACTIVE_ARCH=NO | xcpretty
- name: Publish Cocoapod
run: pod trunk push
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}