Skip to content

Commit

Permalink
Add Deploy CocoaPod (#70)
Browse files Browse the repository at this point in the history
* + add podsec [skip ci]

* + Update CICD
  • Loading branch information
iletai authored Mar 29, 2024
1 parent 029f4e8 commit fe5d660
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 1 deletion.
82 changes: 82 additions & 0 deletions .github/workflows/deploycocoapod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Deploy Version To Cocoapods

on:
workflow_call:
secrets:
token:
required: true
push:
tags:
- v*.*.*
jobs:
deploytag:
name: Setup Tag
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- macos-14
swift:
- "5.9"
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install Cocoapod
run: gem install cocoapods
- name: Compress Push To Cocoapods
run: |
set -eo pipefail
pod lib lint --allow-warnings
# Set version source pod spec and remove v before tag version example v1.4.2 -> 1.4.2
version=$(echo "${GITHUB_REF}" | sed -e "s/^refs\/tags\/v//")
sed -i '' "s/s.version = '.*'/s.version = '${version}'/" Pod/Source/YourPod.podspec
pod trunk push --allow-warnings
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPOD_TOKEN }}
informstatus:
name: Inform Status Release Deploy To Cocoapods
needs: deploytag
runs-on: ubuntu-latest
# Check status of deploytag job with sucess and failure
if: ${{ needs.deploytag.result == 'success' }}
steps:
- name: Send Slack Message
uses: rtCamp/action-slack-notify@v2
with:
status: ${{ job.status }}
author_name: ${{ github.actor }}
author_icon: ${{ github.actor }}
title: ${{ github.event_name }}
text: ${{ github.event_name }} - ${{ github.sha }}
fields: ${{ job.status }}
color: ${{ job.status }}
author_link: ${{ github.event.sender.html_url }}
footer: ${{ github.event.repository.full_name }}
footer_icon: ${{ github.event.repository.owner.avatar_url }}
ts: ${{ github.run_id }}
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
informstatusfailure:
name: Inform Status Release Deploy To Cocoapods
needs: deploytag
runs-on: ubuntu-latest
# Check status of deploytag job with sucess and failure
if: ${{ needs.deploytag.result == 'failure' }}
steps:
- name: Send Slack Message
uses: rtCamp/action-slack-notify@v2
with:
status: ${{ job.status }}
author_name: ${{ github.actor }}
author_icon: ${{ github.actor }}
title: ${{ github.event_name }}
text: ${{ github.event_name }} - ${{ github.sha }}
fields: ${{ job.status }}
color: ${{ job.status }}
author_link: ${{ github.event.sender.html_url }}
footer: ${{ github.event.repository.full_name }}
footer_icon: ${{ github.event.repository.owner.avatar_url }}
ts: ${{ github.run_id }}
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ To integrate SwiftUICalendarView into your project, add the GitHub URL to the de

```swift
dependencies: [
.package(url: "https://github.com/iletai/SwiftUICalendarView.git", from: "1.0.4"),
.package(url: "https://github.com/iletai/SwiftUICalendarView.git", from: "v1.0.4"),
],
targets: [
.target(name: "YourTarget", dependencies: ["CalendarView"]),
Expand Down

0 comments on commit fe5d660

Please sign in to comment.