-
Notifications
You must be signed in to change notification settings - Fork 241
84 lines (70 loc) · 2 KB
/
primary.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#
# 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_15.0.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@v4
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@v4
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