MOB-913 Fix workflow syntax error (#105) #100
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: [ "main" ] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: macos-latest | |
name: Build and Test Swift Package | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build | |
run: swift build -v | |
- name: Run tests | |
run: | | |
swift test --enable-code-coverage -v | |
xcrun llvm-cov export -format="lcov" .build/debug/PaystackSDKPackageTests.xctest/Contents/MacOS/PaystackSDKPackageTests -instr-profile .build/debug/codecov/default.profdata > info.lcov | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
PodLinting: | |
runs-on: macos-12 | |
name: Lint Podspec | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: setup-cocoapods | |
uses: maxim-lobanov/setup-cocoapods@v1 | |
with: | |
version: 1.11.3 | |
- name: Run pod lint for Paystack Core | |
run: pod lib lint PaystackCore.podspec --allow-warnings | |
# TODO: Add sonar here once the project is added | |
release: | |
if: ${{ github.event.pull_request.merged == true && github.head_ref == 'release/update-versions' }} | |
runs-on: macos-12 | |
needs: [build, PodLinting] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Get version information | |
run: | | |
version=$(/usr/libexec/PlistBuddy -c "Print Version" ./Sources/PaystackSDK/Versioning/versions.plist) | |
echo "version=${version}" >> $GITHUB_ENV | |
body=$(/usr/libexec/PlistBuddy -c "Print Description" ./Sources/PaystackSDK/Versioning/versions.plist) | |
echo "body=${body}" >> $GITHUB_ENV | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ env.version }} | |
release_name: ${{ env.version }} | |
body: ${{ env.body }} | |
- name: Install Cocoapods | |
run: gem install cocoapods | |
- name: Deploy to Cocoapods | |
run: | | |
set -eo pipefail | |
pod trunk push PaystackCore.podspec --allow-warnings | |
pod trunk push PaystackUI.podspec --allow-warnings | |
env: | |
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} |