Skip to content

Commit

Permalink
manually apply upstream change
Browse files Browse the repository at this point in the history
  • Loading branch information
mjtalbot committed Jun 4, 2024
1 parent 694ce3b commit 97daf48
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 13 deletions.
38 changes: 36 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
with:
aws-region: us-west-2
role-to-assume: ${{ secrets.ACTIONS_ROLE }}

- name: Checkout Code
uses: actions/checkout@v3
with:
Expand All @@ -52,6 +53,7 @@ jobs:
mkdir bin
cp premake5 bin/premake5
sudo mv premake5 /usr/local/bin
- name: Build skia files
run: ./scripts/build.skia.sh -a ${{ matrix.arch }}

Expand All @@ -64,37 +66,41 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install dependencies
run: npm ci
working-directory: ./.github/release

- if: ${{ inputs.major == true }}
id: determine_version_major
name: Get Version - MAJOR
run: npm run release -- major --ci --release-version | tail -n 1 > RELEASE_VERSION
working-directory: ./.github/release
env:
GITHUB_TOKEN: ${{ secrets.PAT_GITHUB }}

- if: ${{inputs.major == false && inputs.minor == true}}
id: determine_version_minor
name: Get Version - MINOR
run: npm run release -- minor --ci --release-version | tail -n 1 > RELEASE_VERSION
working-directory: ./.github/release
env:
GITHUB_TOKEN: ${{ secrets.PAT_GITHUB }}

- if: ${{ inputs.major == false && inputs.minor == false }}
id: determine_version_patch
name: Get Version - PATCH
run: npm run release -- --ci --release-version | tail -n 1 > RELEASE_VERSION
working-directory: ./.github/release
env:
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
# mini-b was causing issues missing ply
runs-on: [self-hosted, mini-d]
runs-on: ghcr.io/cirruslabs/macos-runner:sonoma
needs: [determine_version]
outputs:
checksum: ${{steps.get_checksum.outputs.checksum}}
Expand All @@ -105,6 +111,12 @@ jobs:
submodules: true
token: ${{ secrets.PAT_GITHUB }}

- name: Configure venv
run: |
python3 -m venv .venv
source .venv/bin/activate
echo PATH=$PATH >> $GITHUB_ENV
- name: Get Renderer ref
id: renderer-ref
run: echo "REF_VALUE=$(cat .rive_renderer)" >> $GITHUB_OUTPUT
Expand All @@ -131,10 +143,13 @@ jobs:
cp premake5 bin/premake5
sudo mv premake5 /usr/local/bin
pip3 install ply
- 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
uses: actions/upload-artifact@v3
with:
Expand All @@ -143,22 +158,27 @@ jobs:
RiveRuntime.xcodeproj/project.pbxproj
Source/Info.plist
Tests/Info.plist
- id: build_frameworks
name: Build frameworks
run: sh ./scripts/build_framework.sh -c Release

- id: zip
name: Zip the framework
# --symlinks is critical here to retain the structure of a macos framework.
run: zip --symlinks -r RiveRuntime.xcframework.zip RiveRuntime.xcframework
working-directory: ./archive

- id: get_checksum
name: Add the checksum of the zip file into our environment
run: echo "::set-output name=checksum::$(swift package compute-checksum archive/RiveRuntime.xcframework.zip)"

- name: Upload xcFramework
uses: actions/upload-artifact@v3
with:
name: RiveRuntime.xcframework.zip
path: archive/RiveRuntime.xcframework.zip

- name: Upload versionFiles
uses: actions/upload-artifact@v3
with:
Expand All @@ -176,6 +196,7 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install dependencies
run: npm ci
working-directory: ./.github/release
Expand All @@ -184,6 +205,7 @@ jobs:
uses: pCYSl5EDgo/cat@master
with:
path: .github/workflows/Package.swift.template

- name: Create Package.swift
run: |
cat > Package.swift <<-EOF
Expand All @@ -197,13 +219,15 @@ jobs:
uses: pCYSl5EDgo/cat@master
with:
path: .github/workflows/RiveRuntime.podspec.template

- name: Create RiveRuntime.podspec
run: |
cat > RiveRuntime.podspec <<-EOF
${{ steps.read_podspec_template.outputs.text }}
EOF
env:
RELEASE_VERSION: ${{ needs.determine_version.outputs.version }}

- name: Upload podspec file
uses: actions/upload-artifact@v2
with:
Expand All @@ -219,29 +243,35 @@ jobs:
run: |
git config --local user.email 'hello@rive.app'
git config --local user.name ${{ github.actor }}
- name: Download versionFiles
uses: actions/download-artifact@v3
with:
name: version-files

- name: Add & commit version files (might want to look into doing this in release-it)
run: git add RiveRuntime.podspec Package.swift Source/Info.plist Tests/Info.plist && git commit -m "Updating version files"

- name: Download framework artifact
uses: actions/download-artifact@v2
with:
name: RiveRuntime.xcframework.zip
path: archive/

- 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
Expand All @@ -258,17 +288,21 @@ jobs:
uses: actions/download-artifact@v3
with:
name: RiveRuntime.xcframework.zip

- name: Download podspec file
uses: actions/download-artifact@v3
with:
name: RiveRuntime.podspec

- name: Download PrivacyInfo file
uses: actions/download-artifact@v3
with:
name: PrivacyInfo.xcprivacy
path: Resources/

- name: Extract archive to pass cocoapods validation
run: unzip RiveRuntime.xcframework.zip

- name: Publish pod to the CocoaPods
uses: michaelhenry/deploy-to-cocoapods-github-action@1.0.10
env:
Expand Down
19 changes: 13 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ jobs:
strategy:
matrix:
arch: ["x86", "x64", "arm", "arm64", "iossim_arm64"]
# mini-b was causing issues missing ply
runs-on: [self-hosted, mini-d]
runs-on: ghcr.io/cirruslabs/macos-runner:sonoma
permissions:
id-token: write
contents: read
Expand All @@ -22,6 +21,7 @@ jobs:
with:
aws-region: us-west-2
role-to-assume: ${{ secrets.ACTIONS_ROLE }}

- name: Checkout Code
uses: actions/checkout@v3
with:
Expand All @@ -46,21 +46,26 @@ jobs:
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
# mini-b was causing issues missing ply
runs-on: [self-hosted, mini-d]
runs-on: ghcr.io/cirruslabs/macos-runner:sonoma
steps:
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.PAT_GITHUB }}
submodules: true

- name: Configure venv
run: |
python3 -m venv .venv
source .venv/bin/activate
echo PATH=$PATH >> $GITHUB_ENV
- name: Installing pre-requisites
run: |
set -x
Expand All @@ -76,7 +81,8 @@ jobs:
pip3 install ply
- name: Build everything WITHOUT Rive Renderer
run: ./scripts/build.sh ios_sim release
run: |
./scripts/build.sh ios_sim release
- name: Testing iOS app WITHOUT Rive Renderer
run: ./scripts/test.sh
Expand All @@ -95,7 +101,8 @@ jobs:
ref: ${{ steps.renderer-ref.outputs.REF_VALUE }}

- name: Build everything (using the cache, we should make an archive of course)
run: ./scripts/build.sh ios_sim release
run: |
./scripts/build.sh ios_sim release
- name: Testing iOS app
run: ./scripts/test.sh
2 changes: 1 addition & 1 deletion .rive_head
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d331aacee4d86875a9d0c72bac811714425f9037
2d9f4d3909834a4fe3d153dfd03e803545e424e3
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ In addition to tests in the project, you may want to visually test out any chang
### Linting and tests

- We currently do not have any automatic linting set up.
- Tests are run on pull request, and you should be able to run tests via xcode in the `RiveRuntime` project
- Tests are run on pull request, and you should be able to run tests via xcode in the `RiveRuntime` project.

## Scripts

Expand Down
6 changes: 3 additions & 3 deletions scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ set -eo pipefail

# test RiveRuntime on a simulator
xcodebuild -workspace Rive.xcworkspace \
-scheme RiveRuntime \
-destination platform=iOS\ Simulator,name=iPhone\ 11 \
clean test | xcpretty
-scheme RiveRuntime \
-destination platform=iOS\ Simulator,name=iPhone\ 15 \
clean test | xcpretty

0 comments on commit 97daf48

Please sign in to comment.