Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Release with github actions #67

Merged
merged 7 commits into from
Apr 18, 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
66 changes: 66 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Release

on:
pull_request:
branches:
- main
types:
- closed

permissions:
contents: write
pages: write
id-token: write

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
docs:
runs-on: macos-latest
steps:
- uses: actions/checkout@v1
- name: Publish Jazzy Docs
uses: steven0351/publish-jazzy-docs@v1
with:
personal_access_token: ${{ secrets.ACCESS_TOKEN }}
branch: main

release:
if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'release/')
environment: Production
outputs:
tag: ${{ steps.semver.outputs.nextStrict }}
runs-on: macos-latest
steps:
- name: Checkout TIKI SDK iOS
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get Version
id: semver
uses: ietf-tools/semver-action@v1
with:
token: ${{ github.token }}

- name: Create a new tag
run: |
git tag ${{ steps.semver.outputs.nextStrict }}
git push origin ${{ steps.semver.outputs.nextStrict }}

- name: Deploy to Cocoapods
run: |
set -eo pipefail
pod lib lint --allow-warnings
pod trunk push TikiSdkDebug.podspec --allow-warnings
pod trunk push TikiSdkRelease.podspec --allow-warnings
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}

- name: Create a Release
continue-on-error: true
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.semver.outputs.nextStrict }}
35 changes: 35 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Test

on:
pull_request:
branches:
- main

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
test:
runs-on: macos-latest
steps:
- name: Checkout TIKI SDK iOS
uses: actions/checkout@v4

- name: Setup XCode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable

- name: Run pod linter
run: pod lib lint --allow-warnings

- name: Setup workspace
run: |
cd Example
pod install --repo-update

- name: Run tests
run: |
cd Example
xcodebuild test -workspace TikiClient.xcworkspace -scheme TikiClient-Example -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14'
55 changes: 55 additions & 0 deletions .github/workflows/version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Version

on:
pull_request:
branches:
- main

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
version:
if: startsWith(github.head_ref, 'release/')
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.semver.outputs.nextStrict }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Checkout PR
id: getpr
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
gh pr checkout ${{ github.event.pull_request.number }}
export PR_BRANCH=$(git branch --show-current)
echo "branch=$PR_BRANCH" >> $GITHUB_OUTPUT

- name: Get Version
id: semver
uses: ietf-tools/semver-action@v1
with:
token: ${{ github.token }}
branch: ${{ steps.getpr.outputs.branch }}

- name: Update Podspec
run: |
sed -i 's/${{ steps.semver.outputs.current }}/${{ steps.semver.outputs.nextStrict }}/' TikiClient.podspec
sed -i 's/${{ steps.semver.outputs.current }}/${{ steps.semver.outputs.nextStrict }}/' README.md

- name: Commit Changes
continue-on-error: true
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
git config --global user.email "[email protected]"
git config --global user.name "GH Action"
git add TikiClient.podspec
git add README.md
git commit -m 'ci: version bump'
git push
12 changes: 5 additions & 7 deletions Example/Podfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
platform :ios, '15.0'

source 'https://cdn.cocoapods.org/'

use_frameworks!

platform :ios, '15.0'

target 'TikiClient_Example' do
pod 'TikiClient', :path => '../'
pod 'TikiClient', :path => '../'
end

target 'TikiClientExampleTests' do
pod 'TikiClient', :path => '../'
pod 'CryptoSwift'
end

end
20 changes: 5 additions & 15 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,33 +1,23 @@
PODS:
- AppAuth (1.6.2):
- AppAuth/Core (= 1.6.2)
- AppAuth/ExternalUserAgent (= 1.6.2)
- AppAuth/Core (1.6.2)
- AppAuth/ExternalUserAgent (1.6.2):
- AppAuth/Core
- CryptoSwift (1.8.1)
- TikiClient (0.1.0):
- AppAuth
- CryptoSwift (1.8.2)
- TikiClient (0.0.2):
- CryptoSwift

DEPENDENCIES:
- CryptoSwift
- TikiClient (from `../`)

SPEC REPOS:
trunk:
- AppAuth
- CryptoSwift

EXTERNAL SOURCES:
TikiClient:
:path: "../"

SPEC CHECKSUMS:
AppAuth: 3bb1d1cd9340bd09f5ed189fb00b1cc28e1e8570
CryptoSwift: b9c701d6f5011df23794dbf7f2e480a77835d83d
TikiClient: 3a91dc7c2954d54e92f8a1f2f132844c29a50cbb
CryptoSwift: c63a805d8bb5e5538e88af4e44bb537776af11ea
TikiClient: a267c74ffcf7ebe39e869e602d26caf05aebeeb6

PODFILE CHECKSUM: 7501e71a92a5f280b97aaf5f199fa519634e934c
PODFILE CHECKSUM: 40b4e084f57008f1517e1137525ad282b8756281

COCOAPODS: 1.15.2
Loading
Loading