Update CI for macOS 13 #100
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
# | |
# This file is part of the PocketSVG package. | |
# | |
# Copyright (c) Ponderwell, Ariel Elkin, Fjölnir Ásgeirsson, and Contributors | |
# For the full copyright and license information, please view the LICENSE | |
# file that was distributed with this source code. | |
# | |
name: CI | |
on: | |
push: | |
branches: [master] | |
tags: | |
- '*' # run on every tag | |
pull_request: | |
jobs: | |
primary: | |
name: Primary | |
runs-on: macOS-13 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Select Xcode | |
run: sudo xcode-select -s /Applications/Xcode_13.2.app | |
- name: Build demos | |
run: sh ci/build_demos.sh | |
- name: Run unit tests | |
run: sh ci/test.sh | |
spm: | |
name: Swift Package Manager | |
runs-on: macOS-13 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Swift Build | |
run: swift build | |
cocoapods: | |
name: Cocoapods | |
runs-on: macOS-13 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Lint Podspec | |
run: pod lib lint | |
xcframework: | |
name: XCFramework | |
runs-on: macOS-13 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build XCFramework | |
run: ci/build_xcframework.sh | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: PocketSVG.xcframework | |
path: derived_data/xcframework/PocketSVG.xcframework | |
retention-days: 5 | |
create-release: | |
name: Make release | |
runs-on: macOS-13 | |
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') # only if tag is pushed | |
needs: [primary, cocoapods, spm, xcframework] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/download-artifact@v2 | |
with: | |
name: PocketSVG.xcframework | |
path: PocketSVG.xcframework | |
- name: Make release | |
run: | | |
echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token | |
TAG_NAME=${GITHUB_REF#refs/*/} | |
zip -r9 "PocketSVG.xcframework.zip" "PocketSVG.xcframework" | |
gh release create $TAG_NAME --notes "" | |
gh release upload $TAG_NAME PocketSVG.xcframework.zip |