Skip to content

Commit

Permalink
adding all the updates to make ios build from the mono repo, and push…
Browse files Browse the repository at this point in the history
… downstream

just tagging you all for visibility  will pepper a few comments in here and hit merge....

Diffs=
90e1d4cf7 renamed release script to releaase & removed unused scripts
418044ebf updates to renderer build defines
a1af986be adding all the updates to make ios build from the mono repo, and push downstream
  • Loading branch information
mjtalbot committed Jul 7, 2022
1 parent 2f13732 commit 5708699
Show file tree
Hide file tree
Showing 12 changed files with 351 additions and 282 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,61 @@ name: Create a Release

on:
workflow_dispatch:
pull_request:
types: [closed]
branches:
- main
inputs:
major:
description: 'Major'
type: boolean
default: false
minor:
description: 'Minor'
type: boolean
default: false

jobs:
build-skia:
strategy:
matrix:
arch: ["x86" , "x64", "arm", "arm64", "iossim_arm64"]

runs-on: macos-12
permissions:
id-token: write
contents: read
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-region: us-west-2
role-to-assume: ${{ secrets.ACTIONS_ROLE }}
- name: Checkout Code
uses: actions/checkout@v3
with:
submodules: true
token: ${{ secrets.PAT_GITHUB }}

- name: Update Java
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '16'

- name: Installing pre-requisites
run: |
set -x
# Install some dependencies & premake5
brew install ninja
wget https://github.com/premake/premake-core/releases/download/v5.0.0-beta1/premake-5.0.0-beta1-macosx.tar.gz
tar -xf premake-5.0.0-beta1-macosx.tar.gz
mkdir bin
cp premake5 bin/premake5
sudo chmod a+x premake5
sudo mv premake5 /usr/local/bin
- name: Build skia files
run: ./scripts/build.skia.sh -a ${{ matrix.arch }}

determine_version:
name: Determine the next build version
if: github.event.pull_request.merged == true
needs: build-skia
runs-on: ubuntu-latest
outputs:
version: ${{ steps.echo_version.outputs.version }}
Expand All @@ -25,27 +71,37 @@ jobs:
run: npm run release -- --ci --release-version | tail -n 1 > RELEASE_VERSION
working-directory: ./.github/release
env:
GITHUB_TOKEN: ${{ secrets.RIVE_REPO_PAT }}
GITHUB_TOKEN: ${{ secrets.PAT_GITHUB }}
- id: echo_version
run: echo "::set-output name=version::$(cat ./.github/release/RELEASE_VERSION)"

build_framework:
name: Create RiveRuntime.xcframework
if: github.event.pull_request.merged == true
runs-on: macos-12
needs: [determine_version]
outputs:
checksum: ${{steps.get_checksum.outputs.checksum}}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
token: ${{ secrets.RIVE_REPO_PAT }}
submodules: recursive
- name: Init submodule
run: git submodule update --init
- name: Configure Skia
run: sh ./scripts/configure.sh
- name: Checkout Code
uses: actions/checkout@v3
with:
submodules: true
token: ${{ secrets.PAT_GITHUB }}
- name: Copy build files
run: ./scripts/copy.build.files.sh
- name: Installing pre-requisites
run: |
set -x
# Install some dependencies & premake5
brew install ninja
wget https://github.com/premake/premake-core/releases/download/v5.0.0-beta1/premake-5.0.0-beta1-macosx.tar.gz
tar -xf premake-5.0.0-beta1-macosx.tar.gz
mkdir bin
cp premake5 bin/premake5
sudo chmod a+x premake5
sudo mv premake5 /usr/local/bin
- name: Build everything (using the cache, we should make an archive of course)
run: ./scripts/build.sh all
- name: Update Marketing versions
run: agvtool new-marketing-version ${{ needs.determine_version.outputs.version }}
- name: Upload versionFiles
Expand Down Expand Up @@ -88,12 +144,11 @@ jobs:
do_release:
name: Do the actual release
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
needs: [determine_version, build_framework]
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install dependencies
Expand Down Expand Up @@ -145,11 +200,24 @@ jobs:
with:
name: RiveRuntime.xcframework.zip
path: archive/
- name: Bump version number, update changelog, push and tag
- if : ${{ inputs.major == true }}
name: Major Release - Bump version number, update changelog, push and tag
run: npm run release -- major --ci
working-directory: ./.github/release
env:
GITHUB_TOKEN: ${{ secrets.PAT_GITHUB }}
- if : ${{inputs.major == false && inputs.minor == true}}
name: Minor release - Bump version number, update changelog, push and tag
run: npm run release -- minor --ci
working-directory: ./.github/release
env:
GITHUB_TOKEN: ${{ secrets.PAT_GITHUB }}
- if : ${{inputs.major == false && inputs.minor == false}}
name: Build release - Bump version number, update changelog, push and tag
run: npm run release -- --ci
working-directory: ./.github/release
env:
GITHUB_TOKEN: ${{ secrets.RIVE_REPO_PAT }}
GITHUB_TOKEN: ${{ secrets.PAT_GITHUB }}

publish_cocoapods:
name: Publish framework to cocoapods
Expand Down
97 changes: 0 additions & 97 deletions .github/workflows/test_build_pod.yml

This file was deleted.

68 changes: 62 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,74 @@ name: Run Rive tests

on:
push:
branches:
- main

jobs:
build-skia:
strategy:
matrix:
arch: ["x86" , "x64", "arm", "arm64", "iossim_arm64"]

runs-on: macos-12
permissions:
id-token: write
contents: read
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-region: us-west-2
role-to-assume: ${{ secrets.ACTIONS_ROLE }}
- name: Checkout Code
uses: actions/checkout@v3
with:
submodules: true
token: ${{ secrets.PAT_GITHUB }}

- name: Update Java
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '16'

- name: Installing pre-requisites
run: |
set -x
# Install some dependencies & premake5
brew install ninja
wget https://github.com/premake/premake-core/releases/download/v5.0.0-beta1/premake-5.0.0-beta1-macosx.tar.gz
tar -xf premake-5.0.0-beta1-macosx.tar.gz
mkdir bin
cp premake5 bin/premake5
sudo chmod a+x premake5
sudo mv premake5 /usr/local/bin
- name: Build skia files
run: ./scripts/build.skia.sh -a ${{ matrix.arch }}

run_tests:
name: Run Rive tests
needs: build-skia
runs-on: macos-12
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
token: ${{ secrets.RIVE_REPO_PAT }}
submodules: recursive
- name: Get Skia Headers
run: sh ./scripts/configure.sh
token: ${{ secrets.PAT_GITHUB }}
submodules: true
- name: Installing pre-requisites
run: |
set -x
# Install some dependencies & premake5
brew install ninja
wget https://github.com/premake/premake-core/releases/download/v5.0.0-beta1/premake-5.0.0-beta1-macosx.tar.gz
tar -xf premake-5.0.0-beta1-macosx.tar.gz
mkdir bin
cp premake5 bin/premake5
sudo chmod a+x premake5
sudo mv premake5 /usr/local/bin
- name: Build everything (using the cache, we should make an archive of course)
run: ./scripts/build.sh ios_sim debug
- name: Testing iOS app
run: sh ./scripts/test.sh
run: ./scripts/test.sh

2 changes: 1 addition & 1 deletion .rive_head
Original file line number Diff line number Diff line change
@@ -1 +1 @@
94444dbd24884c250a3c00f19ece386ee5ac93e5
90e1d4cf7e5ec3d3286d2234c2fd1f1125e10efa
12 changes: 2 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,14 @@ Check out the repository, making sure to include the submodules. It is important
`git clone --recurse-submodules git@github.com:rive-app/rive-ios.git`

The package relies on skia, as well as rive-cpp in order to be built. To shorten the build cycle, we rely on compiled libraries for skia, rive & rive-skia-renderer.
The `./scripts/configure.sh` script will download or build appropriate libraries, be sure to run configure when making changes to our rive-cpp submodule.
The `./scripts/build.sh all` script will download or build appropriate libraries, be sure to run configure when making changes to our rive-cpp submodule.

### Uploading caches

If you are contributing and you have access to Rives' aws environment, make you sure install `aws-cli` and configure it with your credentials. If you run into permission issues here `aws sts get-caller-identity` can help make sure that your local developer environment is setup to talk to AWS correctly.
See https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html

Note: on Mac, I just did 'brew install awscli'

Set the `RIVE_UPLOAD_IOS_ARCHIVE` env variable to `TRUE`

`RIVE_UPLOAD_IOS_ARCHIVE=TRUE ./scripts/configure.sh`

and it will upload caches when feasible. To force a rebuild, add `rebuild` as an argument...

`RIVE_UPLOAD_IOS_ARCHIVE=TRUE ./scripts/configure.sh rebuild`
Note: on a Mac with brew, you can simply run 'brew install awscli'

Note: the 'dependencies' directory is just a cache of what the configure.sh script downloads. It can be removed if you suspect is is out of date, and then just rerun the script (./scripts/configure.sh)

Expand Down
Loading

0 comments on commit 5708699

Please sign in to comment.