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

chore: update release workflows to trigger CocoaPod Publish workflow on new tag push #188

Merged
merged 1 commit into from
Feb 14, 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
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
Loading