Skip to content

Commit

Permalink
better actions
Browse files Browse the repository at this point in the history
ypopovych committed Nov 17, 2023
1 parent f7cf0c8 commit b8e047f
Showing 3 changed files with 36 additions and 9 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/on_new_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: On new release
on:
release:
types: [created]
jobs:
publish_pod:
uses: "./.github/workflows/publish_pod.yml"
with:
version: ${{ github.event.release.tag_name }}
secrets:
trunk-token: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
24 changes: 16 additions & 8 deletions .github/workflows/publish_pod.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
name: Publish CocoaPods package
name: Publish to CocoaPods
on:
release:
types: [created]
workflow_call:
inputs:
version:
required: true
type: string
secrets:
trunk-token:
required: true
jobs:
publish:
runs-on: macOS-13
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ inputs.version }}
- name: Select Xcode
run: sudo xcode-select -s /Applications/Xcode_14.3.1.app
- name: Set release version
run: sed -i '' "s|[[:blank:]]*s\.version[[:blank:]].*|s.version = '${VERSION}'|g" *.podspec
env:
VERSION: ${{ github.event.release.tag_name }}
VERSION: ${{ inputs.version }}
- name: Set Core binary URL
run:
FILE_URL=$(sed -n 's|let[[:blank:]]*binaryUrl[[:blank:]]*=[[:blank:]]*"\(.*\)"|\1|p' Package.swift)
@@ -25,16 +33,16 @@ jobs:
- name: Publish Core Pod
run: pod trunk push --allow-warnings --synchronous Tesseract-Core.podspec
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
COCOAPODS_TRUNK_TOKEN: ${{ secrets.trunk-token }}
- name: Publish Shared Pod
run: pod trunk push --allow-warnings --synchronous Tesseract-Shared.podspec
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
COCOAPODS_TRUNK_TOKEN: ${{ secrets.trunk-token }}
- name: Publish Client Pod
run: pod trunk push --allow-warnings --synchronous Tesseract-Client.podspec
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
COCOAPODS_TRUNK_TOKEN: ${{ secrets.trunk-token }}
- name: Publish Service Pod
run: pod trunk push --allow-warnings --synchronous Tesseract-Service.podspec
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
COCOAPODS_TRUNK_TOKEN: ${{ secrets.trunk-token }}
10 changes: 9 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -30,6 +30,7 @@ on:
required: false
jobs:
build-core-and-deploy:
name: Build Core
runs-on: macOS-13
steps:
- name: Checkout
@@ -82,4 +83,11 @@ jobs:
prerelease: ${{ inputs.prerelease }}
draft: ${{ inputs.draft }}
files: ${{ steps.build-core-zip.outputs.ZIP_NAME }}

publish-pod:
name: Publish to Cocoa Pods
needs: build-core-and-deploy
uses: "./.github/workflows/publish_pod.yml"
with:
version: ${{ inputs.version }}
secrets:
trunk-token: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}

0 comments on commit b8e047f

Please sign in to comment.