-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
98 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
name: Build Rive framework | ||
|
||
on: | ||
release: | ||
types: [released] | ||
|
||
jobs: | ||
build_frameworks: | ||
name: Create RiveRuntime.xcframework | ||
runs-on: macos-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
token: ${{ secrets.RIVE_REPO_PAT }} | ||
submodules: recursive | ||
- name: Init submodule | ||
run: git submodule update --init | ||
- id: build_iphoneos | ||
name: Build release iphoneos framework | ||
run: sh ./scripts/buildFramework.sh -t iphoneos -c Release | ||
- id: build_iphonesimulator | ||
name: Build release iphonesimulator framework | ||
run: sh ./scripts/buildFramework.sh -t iphonesimulator -c Release | ||
- id: merge_frameworks | ||
if: steps.build_iphoneos.conclusion == 'success' && steps.build_iphonesimulator.conclusion == 'success' | ||
name: Merge created frameworks | ||
run: sh ./scripts/mergeFrameworks.sh -c Release | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: RiveRuntime.xcframework | ||
path: build/RiveRuntime.xcframework | ||
|
||
create_podspec_file: | ||
name: Create RiveRuntime.podspec | ||
runs-on: macos-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
token: ${{ secrets.RIVE_REPO_PAT }} | ||
submodules: recursive | ||
- name: Read podspec.txt file | ||
uses: pCYSl5EDgo/cat@master | ||
id: podspec | ||
with: | ||
path: .github/workflows/podspec.txt | ||
- name: Create *.podspec | ||
run: | | ||
cat > RiveRuntime.podspec <<-EOF | ||
${{ steps.podspec.outputs.text }} | ||
EOF | ||
env: | ||
GITHUB_AUTHOR: ${{ github.actor }} | ||
RELEASE_VERSION: ${{ github.event.release.tag_name }} | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: RiveRuntime.podspec | ||
path: RiveRuntime.podspec | ||
|
||
upload_cocoapods: | ||
name: Update podspec repository | ||
runs-on: macos-latest | ||
timeout-minutes: 10 | ||
needs: [create_podspec_file, build_frameworks] | ||
steps: | ||
- name: Checkout podspec repo | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: rive-app/test-ios | ||
token: ${{ secrets.RIVE_REPO_PAT }} | ||
- name: Clean | ||
run: | | ||
rm -rf RiveRuntime.podspec | ||
rm -rf RiveRuntime.xcframework | ||
- name: Download framework artifact | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: RiveRuntime.xcframework | ||
path: RiveRuntime.xcframework | ||
- name: Download podspec artifact | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: RiveRuntime.podspec | ||
- name: Lint pod | ||
run: pod lib lint --allow-warnings | ||
- name: Push pod to test-ios repo | ||
run: | | ||
git status | ||
git config --local user.email '[email protected]' | ||
git config --local user.name ${{ github.actor }} | ||
git add . | ||
git commit -m "Update podspec repo tag:${{ github.event.release.tag_name }}" | ||
git push | ||
env: | ||
API_TOKEN_GITHUB: ${{ secrets.RIVE_REPO_PAT }} |