diff --git a/.github/codecov.yml b/.github/codecov.yml
new file mode 100644
index 0000000..ab4134f
--- /dev/null
+++ b/.github/codecov.yml
@@ -0,0 +1,13 @@
+coverage:
+ status:
+ project:
+ default:
+ threshold: 1
+ patch:
+ default:
+ target: 0%
+ threshold: 1
+codecov:
+ max_report_age: off
+github_checks:
+ annotations: false
\ No newline at end of file
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 0000000..8016bea
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,105 @@
+name: Build Library
+
+on:
+ push:
+ branches: [ main ]
+ pull_request:
+ branches: [ main ]
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
+jobs:
+
+ lint_ios_podspec:
+ name: Lint iOS Podspec
+ runs-on: macos-14
+ if: github.event_name == 'pull_request'
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+ - name: Lint Podspec
+ run: pod lib lint --private --verbose --sources=https://github.com/CruGlobal/cocoapods-specs.git,https://cdn.cocoapods.org/
+
+ current_version:
+ name: Store Current Version
+ runs-on: ubuntu-latest
+ if: (github.event_name == 'push' && github.ref == 'refs/heads/main')
+ outputs:
+ version: ${{ steps.version.outputs.version }}
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+ - name: Set Version Output
+ id: version
+ run: grep s\\.version\\s SocialAuthentication.podspec | sed 's/s.//' | sed "s/'//g" | sed 's/ //g' >> $GITHUB_OUTPUT
+
+ print_current_version:
+ name: Print Current Version
+ runs-on: ubuntu-latest
+ if: (github.event_name == 'push' && github.ref == 'refs/heads/main')
+ needs: [ current_version ]
+ steps:
+ - name: Print Current Version
+ env:
+ VERSION: ${{ needs.current_version.outputs.version }}
+ run: |
+ printf '%s\n' "$VERSION"
+
+ check_version:
+ name: Verify Version Is Not Released
+ runs-on: ubuntu-latest
+ if: (github.event_name == 'push' && github.ref == 'refs/heads/main')
+ needs: [ current_version ]
+ outputs:
+ tag: ${{ steps.tag_name.outputs.tag }}
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+ - name: Generate Tag Name
+ id: tag_name
+ run: echo tag=$TAG_NAME >> $GITHUB_OUTPUT
+ env:
+ TAG_NAME: ${{ needs.current_version.outputs.version }}
+ - name: Check if version was already released
+ run: "! git ls-remote -t --exit-code origin $TAG_NAME"
+ env:
+ TAG_NAME: ${{ steps.tag_name.outputs.tag }}
+
+ tag_version:
+ name: Tag Version
+ runs-on: ubuntu-latest
+ if: (github.event_name == 'push' && github.ref == 'refs/heads/main')
+ needs: [ check_version, current_version ]
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+ - name: Create Tag
+ env:
+ TAG_NAME: ${{ needs.current_version.outputs.version }}
+ run: |
+ git tag $TAG_NAME
+ git push origin $TAG_NAME
+
+ push_podspec:
+ name: Push Podspec
+ runs-on: macos-14
+ if: (github.event_name == 'push' && github.ref == 'refs/heads/main')
+ needs: [ check_version, tag_version ]
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+ - name: Setup Ruby
+ uses: ruby/setup-ruby@v1
+ with:
+ bundler-cache: true
+ - name: Install SSH key
+ uses: shimataro/ssh-key-action@v2
+ with:
+ key: ${{ secrets.SSH_KEY }}
+ known_hosts: ${{ secrets.KNOWN_HOSTS }}
+ - name: Add CruGlobal CocoaPods Repo
+ run: pod repo add CruGlobal git@github.com:CruGlobal/cocoapods-specs.git
+ - name: Push podspec
+ run: pod repo push CruGlobal *.podspec --private --verbose --sources=https://github.com/CruGlobal/cocoapods-specs.git,https://cdn.cocoapods.org/
\ No newline at end of file
diff --git a/.github/workflows/create-version.yml b/.github/workflows/create-version.yml
new file mode 100644
index 0000000..6f1e619
--- /dev/null
+++ b/.github/workflows/create-version.yml
@@ -0,0 +1,176 @@
+name: Create Version
+
+on:
+ push:
+ branches: [ main ]
+ pull_request:
+ branches: [ main ]
+
+ workflow_dispatch:
+ inputs:
+ versionIncrementType:
+ description: 'Version Increment Type'
+ required: true
+ default: 'patch'
+ type: choice
+ options:
+ - patch
+ - minor
+ - major
+ - manual
+ manualVersionNumber:
+ description: 'Manually Enter Version Number (Requires manual Version Increment Type)'
+ required: false
+ type: string
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
+jobs:
+
+ version_increment_is_bump:
+ name: Check If Version Increment Is Bump
+ runs-on: ubuntu-latest
+ if: github.event_name == 'workflow_dispatch'
+ outputs:
+ isBump: ${{ steps.check_if_increment_is_bump.outputs.value }}
+ steps:
+ - name: Check If Version Increment Is Bump
+ id: check_if_increment_is_bump
+ run: |
+ if [ ${{ inputs.versionIncrementType }} == 'patch' ]; then
+ echo "value=true" >> "$GITHUB_OUTPUT"
+ elif [ ${{ inputs.versionIncrementType }} == 'minor' ]; then
+ echo "value=true" >> "$GITHUB_OUTPUT"
+ elif [ ${{ inputs.versionIncrementType }} == 'major' ]; then
+ echo "value=true" >> "$GITHUB_OUTPUT"
+ else
+ echo echo "value=false" >> "$GITHUB_OUTPUT"
+ fi
+
+ current_version:
+ name: Store Current Version
+ runs-on: ubuntu-latest
+ if: github.event_name == 'workflow_dispatch'
+ outputs:
+ version: ${{ steps.version.outputs.version }}
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+ - name: Set Version Output
+ id: version
+ run: grep s\\.version\\s SocialAuthentication.podspec | sed 's/s.//' | sed "s/'//g" | sed 's/ //g' >> $GITHUB_OUTPUT
+
+ print_current_version:
+ name: Print Current Version
+ runs-on: ubuntu-latest
+ needs: [ current_version ]
+ steps:
+ - name: Print Current Version
+ env:
+ VERSION: ${{ needs.current_version.outputs.version }}
+ run: |
+ printf '%s\n' "$VERSION"
+
+ bump_version:
+ name: Store Bump Version
+ runs-on: ubuntu-latest
+ outputs:
+ version: ${{ steps.version.outputs.version }}
+ needs: [ current_version, version_increment_is_bump ]
+ steps:
+ - name: Bump Version
+ if: ${{ needs.version_increment_is_bump.outputs.isBump == 'true' }}
+ id: bump-semver
+ uses: actions-ecosystem/action-bump-semver@v1
+ with:
+ current_version: ${{ needs.current_version.outputs.version }}
+ level: ${{ inputs.versionIncrementType }}
+ - name: Store Bump Version
+ id: version
+ run: |
+ echo "version=${{ steps.bump-semver.outputs.new_version }}" >> $GITHUB_OUTPUT
+
+ print_bump_version:
+ name: Print Bump Version
+ runs-on: ubuntu-latest
+ needs: [ bump_version, version_increment_is_bump ]
+ if: ${{ needs.version_increment_is_bump.outputs.isBump == 'true' }}
+ steps:
+ - name: Print Bump Version
+ env:
+ VERSION: ${{ needs.bump_version.outputs.version }}
+ run: |
+ printf '%s\n' "$VERSION"
+
+ manual_version:
+ name: Store Manual Version
+ runs-on: ubuntu-latest
+ outputs:
+ version: ${{ steps.version.outputs.version }}
+ if: inputs.versionIncrementType == 'manual'
+ steps:
+ - name: Store Manual Version
+ id: version
+ run: |
+ echo "version=${{ inputs.manualVersionNumber }}" >> $GITHUB_OUTPUT
+
+ print_manual_version:
+ name: Print Manual Version
+ runs-on: ubuntu-latest
+ needs: [ manual_version ]
+ if: inputs.versionIncrementType == 'manual'
+ steps:
+ - name: Print Manual Version
+ env:
+ VERSION: ${{ needs.manual_version.outputs.version }}
+ run: |
+ printf '%s\n' "$VERSION"
+
+ new_version:
+ name: Store New Version
+ runs-on: ubuntu-latest
+ needs: [ version_increment_is_bump, bump_version ]
+ if: ${{ needs.version_increment_is_bump.outputs.isBump == 'true' || inputs.versionIncrementType == 'manual' }}
+ outputs:
+ version: ${{ steps.version.outputs.version }}
+ steps:
+ - name: Store New Version
+ id: version
+ run: |
+ if [ ${{ needs.version_increment_is_bump.outputs.isBump }} == 'true' ]; then
+ echo "version=${{ needs.bump_version.outputs.version }}" >> $GITHUB_OUTPUT
+ elif [ ${{ inputs.versionIncrementType }} == 'manual' ]; then
+ echo "version=${{ inputs.manualVersionNumber }}" >> $GITHUB_OUTPUT
+ else
+ echo "No Version"
+ fi
+
+ print_new_version:
+ name: Print New Version
+ runs-on: ubuntu-latest
+ needs: [ new_version ]
+ steps:
+ - name: Print New Version
+ env:
+ VERSION: ${{ needs.new_version.outputs.version }}
+ run: |
+ printf '%s\n' "$VERSION"
+
+ create_version_branch_and_pull_request:
+ name: Create Version Branch and PR
+ runs-on: ubuntu-latest
+ needs: [ current_version, new_version ]
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+ - name: Set Podspec Version to New Version
+ run: |
+ sed -i "s/s.version = '${{ needs.current_version.outputs.version }}'/s.version = '${{ needs.new_version.outputs.version }}'/g" SocialAuthentication.podspec
+ - name: Create Version Branch and PR
+ uses: peter-evans/create-pull-request@v6
+ with:
+ branch: "versions/${{ needs.new_version.outputs.version }}"
+ title: "Version ${{needs.new_version.outputs.version}}"
+ commit-message: "Increase version to ${{needs.new_version.outputs.version}}"
\ No newline at end of file
diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml
new file mode 100644
index 0000000..adb21b0
--- /dev/null
+++ b/.github/workflows/run-tests.yml
@@ -0,0 +1,36 @@
+name: Run Tests
+
+on:
+ push:
+ branches: [ develop, main, feature/* ]
+ pull_request:
+ branches: [ develop, main, feature/* ]
+
+permissions:
+ id-token: write
+ contents: read
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ run_tests_and_code_coverage:
+ name: Run Tests and Code Coverage
+ runs-on: macos-14
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+ - name: Select Xcode Version
+ uses: maxim-lobanov/setup-xcode@v1
+ with:
+ xcode-version: '15.4.0'
+ - name: Run Tests
+ run: xcodebuild test -scheme SocialAuthentication -sdk iphonesimulator17.5 -destination "OS=17.5,name=iPhone 15"
+ - name: Upload Xcode Code Coverage Report to CodeCov
+ uses: codecov/codecov-action@v4
+ with:
+ fail_ci_if_error: true
+ token: ${{ secrets.CODECOV_TOKEN }}
+ verbose: true
+ xcode: true
diff --git a/.ruby-version b/.ruby-version
new file mode 100644
index 0000000..3f09e91
--- /dev/null
+++ b/.ruby-version
@@ -0,0 +1 @@
+3.3.3
\ No newline at end of file
diff --git a/.swiftpm/xcode/xcshareddata/xcschemes/SocialAuthentication.xcscheme b/.swiftpm/xcode/xcshareddata/xcschemes/SocialAuthentication.xcscheme
index d2d646a..4a408bb 100644
--- a/.swiftpm/xcode/xcshareddata/xcschemes/SocialAuthentication.xcscheme
+++ b/.swiftpm/xcode/xcshareddata/xcschemes/SocialAuthentication.xcscheme
@@ -26,7 +26,18 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
- shouldUseLaunchSchemeArgsEnv = "YES">
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ codeCoverageEnabled = "YES"
+ onlyGenerateCoverageForSpecifiedTargets = "YES">
+
+
+
+
diff --git a/README.md b/README.md
index 738e534..74280e6 100644
--- a/README.md
+++ b/README.md
@@ -1,25 +1,34 @@
+[![codecov](https://codecov.io/gh/CruGlobal/social-authentication-ios/branch/main/graph/badge.svg)](https://codecov.io/gh/CruGlobal/social-authentication-ios)
+
Social Authentication
=====================
Shared iOS module for authenticating with social platforms GoogleSignIn, FacebookLogin, AppleSignIn.
-- [Publishing New Versions](#publishing-new-versions)
+- [Publishing New Versions With GitHub Actions](#publishing-new-versions-with-github-actions)
+- [Publishing New Versions Manually](#publishing-new-versions-manually)
+
+### Publishing New Versions With GitHub Actions
+
+Publishing new versions with GitHub Actions is easy.
+- Ensure you set a new version in SocialAuthentication.podspec. The new version can't already exist as a tag.
+- Create a pull request on main and once merged into main GitHub actions will handle tagging the version and pushing to the CruGlobal specs repo.
-### Publishing New Versions
+### Publishing New Versions Manually
Steps to publish new versions for Cocoapods and Swift Package Manager.
- Edit SocialAuthentication.podspec s.version to the newly desired version following Major.Minor.Patch.
-- Run command 'pod lib lint SocialAuthentication.podspec' to ensure it can deploy without any issues (https://guides.cocoapods.org/making/using-pod-lib-create.html#deploying-your-library).
+- Run command 'pod lib lint SocialAuthentication.podspec --private --verbose --sources=https://github.com/CruGlobal/cocoapods-specs.git,https://cdn.cocoapods.org/' to ensure it can deploy without any issues (https://guides.cocoapods.org/making/using-pod-lib-create.html#deploying-your-library).
- Merge the s.version change into the main branch and then tag the main branch with the new version and push the tag to remote (Swift Package Manager relies on tags).
-- Run command 'pod repo push cruglobal-cocoapods-specs SocialAuthentication.podspec' to push to CruGlobal cocoapods specs (https://github.com/CruGlobal/cocoapods-specs). You can also run command 'pod repo list' to see what repos are currently added and 'pod repo add cruglobal-cocoapods-specs https://github.com/CruGlobal/cocoapods-specs.git' to add repos (https://guides.cocoapods.org/making/private-cocoapods.html).
+- Run command 'pod repo push cruglobal-cocoapods-specs --private --verbose --sources=https://github.com/CruGlobal/cocoapods-specs.git,https://cdn.cocoapods.org/' to push to CruGlobal cocoapods specs (https://github.com/CruGlobal/cocoapods-specs). You can also run command 'pod repo list' to see what repos are currently added and 'pod repo add cruglobal-cocoapods-specs https://github.com/CruGlobal/cocoapods-specs.git' to add repos (https://guides.cocoapods.org/making/private-cocoapods.html).
Cru Global Specs Repo: https://github.com/CruGlobal/cocoapods-specs
-Private Cocoapods: https://guides.cocoapods.org/making/private-cocoapods.html
+Private Cocoapods: https://guides.cocoapods.org/making/private-cocoapods.html
\ No newline at end of file
diff --git a/SocialAuthentication.podspec b/SocialAuthentication.podspec
index e87f9dc..88ca08e 100644
--- a/SocialAuthentication.podspec
+++ b/SocialAuthentication.podspec
@@ -1,16 +1,13 @@
Pod::Spec.new do |s|
- s.name = 'SocialAuthentication'
- s.version = '0.5.0'
- s.summary = 'Module for obtaining access tokens from social platforms FacebookLogin, GoogleSignIn, and AppleSignIn.'
-
-
- s.description = 'This module implements Classes for obtaining access tokens from FacebookLogin, GoogleSignIn, and AppleSignIn.'
-
- s.homepage = 'https://github.com/CruGlobal/social-authentication-ios'
- s.license = { :type => 'MIT', :file => 'LICENSE' }
- s.author = { 'Levi Eggert' => 'levi.eggert@cru.org' }
- s.source = { :git => 'https://github.com/CruGlobal/social-authentication-ios.git', :tag => s.version.to_s }
+ s.name = 'SocialAuthentication'
+ s.version = '0.5.0'
+ s.summary = 'Module for obtaining access tokens from social platforms FacebookLogin, GoogleSignIn, and AppleSignIn.'
+ s.description = 'This module implements Classes for obtaining access tokens from FacebookLogin, GoogleSignIn, and AppleSignIn.'
+ s.homepage = 'https://github.com/CruGlobal/social-authentication-ios'
+ s.license = { :type => 'MIT', :file => 'LICENSE' }
+ s.author = { 'Levi Eggert' => 'levi.eggert@cru.org' }
+ s.source = { :git => 'https://github.com/CruGlobal/social-authentication-ios.git', :tag => s.version.to_s }
s.swift_version = '5.7'
s.platforms = {