-
Notifications
You must be signed in to change notification settings - Fork 194
139 lines (123 loc) · 4.16 KB
/
release.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: Release
on:
workflow_dispatch:
inputs:
dryRun:
description: "Do a dry run to preview instead of a real release"
required: true
default: "true"
jobs:
authorize:
name: Authorize
runs-on: macos-12
steps:
- name: ${{ github.actor }} permission check to do a release
uses: octokit/[email protected]
with:
route: GET /repos/:repository/collaborators/${{ github.actor }}
repository: ${{ github.repository }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release:
name: Release
runs-on: macos-12
needs: [authorize]
strategy:
matrix:
ruby-version: ["2.7"]
node-version: ["16.x"]
steps:
- name: Checkout Amplitude-iOS
uses: actions/checkout@v2
- name: Set Xcode 14
run: |
sudo xcode-select -switch /Applications/Xcode_14.1.app
- name: Carthage Bootstrap
run: carthage bootstrap --use-xcframeworks
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
- name: Install Cocoapods
run: |
gem install bundler -v 2.4.22
bundle config path vendor/bundle
bundle install
pod install
- name: iOS Tests
run: |
xcodebuild test \
-workspace Amplitude.xcworkspace \
-scheme Amplitude_iOSTests \
-sdk iphonesimulator \
-destination 'platform=iOS Simulator,name=iPhone 14'
# - name: macOS Tests @TODO Fix flaky macOS tests and re-enable
# run: |
# xcodebuild \
# -workspace Amplitude.xcworkspace \
# -scheme Amplitude_macOS \
# -sdk macosx \
# -destination 'platform=macosx' \
# test
- name: tvOS Tests
run: |
xcodebuild \
-workspace Amplitude.xcworkspace \
-scheme Amplitude_tvOS \
-sdk appletvsimulator \
-destination 'platform=tvOS Simulator,name=Apple TV' \
test
- name: Validate Podfile
run: pod lib lint
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Checkout Amplitude-iOS gh-pages for building docs
uses: actions/checkout@v2
with:
ref: "gh-pages"
path: "Amplitude-iOS-gh-pages"
- name: Install appledoc binary
run: |
git clone https://github.com/amplitude/appledoc
cd appledoc/
sudo sh install-appledoc.sh
cd ../
sudo rm -rf appledoc/
- name: Semantic Release --dry-run
if: ${{ github.event.inputs.dryRun == 'true'}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
GIT_AUTHOR_NAME: amplitude-sdk-bot
GIT_AUTHOR_EMAIL: [email protected]
GIT_COMMITTER_NAME: amplitude-sdk-bot
GIT_COMMITTER_EMAIL: [email protected]
run: |
npx \
-p lodash \
-p semantic-release@17 \
-p @semantic-release/changelog@5 \
-p @semantic-release/git@9 \
-p @google/[email protected] \
-p @semantic-release/exec@5 \
semantic-release --dry-run
- name: Semantic Release
if: ${{ github.event.inputs.dryRun == 'false'}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
GIT_AUTHOR_NAME: amplitude-sdk-bot
GIT_AUTHOR_EMAIL: [email protected]
GIT_COMMITTER_NAME: amplitude-sdk-bot
GIT_COMMITTER_EMAIL: [email protected]
run: |
npx \
-p lodash \
-p semantic-release@17 \
-p @semantic-release/changelog@5 \
-p @semantic-release/git@9 \
-p @google/[email protected] \
-p @semantic-release/exec@5 \
semantic-release