Skip to content

Commit

Permalink
chore: update release workflows to trigger CocoaPod Publish workflow …
Browse files Browse the repository at this point in the history
…on new tag push (#188)
  • Loading branch information
kaushalkapasi authored Feb 14, 2024
1 parent 613dcd8 commit 670d5d3
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 37 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/ios.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,23 @@ name: Build and Test iOS

on:
pull_request:
branches: [ main ]
branches: [main]

jobs:
build:
runs-on: macos-12
steps:
- name: Checkout Project
uses: actions/checkout@v4
- name: "Select Latest Xcode"
- name: 'Select Latest Xcode'
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: "Carthage Cached Bootstrap"
- name: 'Carthage Cached Bootstrap'
uses: DevCycleHQ/carthage-bootstrap@xcframeworks2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
use-xcframeworks: true
- name: Fastlane iOS Tests
run: fastlane ios tests

31 changes: 31 additions & 0 deletions .github/workflows/publish-pod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: CocoaPods Publish

on:
push:
tags:
- v*.*.**
workflow_dispatch:

permissions:
contents: write

jobs:
publish-cocoapods:
needs: release
runs-on: macos-12
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.AUTOMATION_USER_TOKEN }}
fetch-depth: 0

- name: Fix WatchOS Simulators
run: |
./scripts/fix_watchos_simulators.sh
- name: Publish to CocoaPods
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
run: |
pod trunk push DevCycle.podspec --allow-warnings --verbose
25 changes: 3 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
name: Release
name: Create Release Tag

on:
workflow_dispatch:
inputs:
prerelease:
description: "Prerelease"
description: 'Prerelease'
required: true
default: false
type: boolean
draft:
description: "Draft"
description: 'Draft'
required: true
default: false
type: boolean
Expand All @@ -29,7 +29,6 @@ permissions:
jobs:
release:
runs-on: ubuntu-latest

steps:
# Check out the repo with credentials that can bypass branch protection, and fetch git history instead of just latest commit
- uses: actions/checkout@v4
Expand Down Expand Up @@ -81,21 +80,3 @@ jobs:
echo "::notice title=Release ID::${{ steps.create-release.outputs.release-id }}"
echo "::notice title=Release URL::${{ steps.create-release.outputs.release-url }}"
publish-cocoapods:
needs: release
runs-on: macos-12
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.AUTOMATION_USER_TOKEN }}
fetch-depth: 0

- name: Fix WatchOS Simulators
run: |
./scripts/fix_watchos_simulators.sh
- name: Publish to CocoaPods
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
run: |
pod trunk push DevCycle.podspec --allow-warnings --verbose
12 changes: 0 additions & 12 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
#!/bin/bash
SHA="$(git rev-parse HEAD)"
DEVCYCLE_PROD_SLEUTH_API_TOKEN="$(aws secretsmanager get-secret-value --secret-id=DEVCYCLE_PROD_SLEUTH_API_TOKEN | jq -r .SecretString )"

# make sure we're able to track this deployment
if [[ -z "$DEVCYCLE_PROD_SLEUTH_API_TOKEN" ]]; then
echo "Sleuth.io deployment tracking token not found. Aborting."
exit 1
fi

# fix watchOS simulators: https://github.com/CocoaPods/CocoaPods/issues/11558#issuecomment-1284573492
echo "Fixing watchOS Simulators"
Expand All @@ -29,8 +22,3 @@ if [[ "$?" != 0 ]]; then
echo "Publish failed. Aborting."
exit 1
fi

curl -X POST \
-d api_key=$DEVCYCLE_PROD_SLEUTH_API_TOKEN \
-d environment=production \
-d sha=$SHA https://app.sleuth.io/api/1/deployments/taplytics/ios-client-sdk/register_deploy

0 comments on commit 670d5d3

Please sign in to comment.