Skip to content

Commit

Permalink
added workflow (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shahroz16 committed May 26, 2024
1 parent 94e66fb commit 346362f
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 2 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/tag-and-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Release with Tag

on:
workflow_dispatch:
inputs:
tag:
description: 'Tag to create and deploy'
required: true

permissions:
contents: write

jobs:
create-tag:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Required due to the way Git works, without it this action won't be able to find any or the correct tags

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0

- name: Install CocoaPods
run: gem install cocoapods

- name: Get current version
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"

- name: Create GitHub Release
uses: actions/create-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.inputs.tag }}
release_name: ${{ github.event.inputs.tag }}
draft: false
prerelease: false
body: |
Changes since [${{ steps.previoustag.outputs.tag }}](https://github.com/${{ github.repository }}/compare/${{ steps.previoustag.outputs.tag }}...${{ github.event.inputs.tag }})
- name: Manually update version and tag in podspec
run: |
sed -i.bak 's/\(version = \)"[^"]*"/\1"${{ github.event.inputs.tag }}"/' AnalyticsSwiftCIO.podspec
rm AnalyticsSwiftCIO.podspec.bak
- name: Commit and push podspec
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "Bump podspec version to ${{ github.event.inputs.tag }}"
file_pattern: AnalyticsSwiftCIO.podspec

- name: Deploy to cocoapoads
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
run: |
pod trunk push AnalyticsSwiftCIO.podspec --allow-warnings
7 changes: 5 additions & 2 deletions AnalyticsSwiftCIO.podspec
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
Pod::Spec.new do |s|

version = "1.5.12+cio.3" # Define your version variable here

s.name = "AnalyticsSwiftCIO"
s.version = "1.5.12+cio.1"
s.version = version
s.license = { :type => 'MIT', :file => './LICENSE' }
s.summary = "Customer.io Data Pipelines analytics client for Swift app (iOS/tvOS/watchOS/macOS/Linux)."
s.homepage = "https://github.com/customerio/cdp-analytics-swift"
s.authors = "Customer.io"

# Make sure the tag is the same as what SPM customers are using.
# update branch to version
s.source = { :git => 'https://github.com/customerio/cdp-analytics-swift.git', :tag => '1.5.12+cio.1' }
s.source = { :git => 'https://github.com/customerio/cdp-analytics-swift.git', :tag => version }

s.ios.deployment_target = "13.0"
s.requires_arc = true
Expand Down

0 comments on commit 346362f

Please sign in to comment.