-
Notifications
You must be signed in to change notification settings - Fork 30
102 lines (93 loc) · 3.04 KB
/
swift.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
name: Swift
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
inputs:
PREP:
required: false
type: boolean
description: prepare to release
RELEASE:
required: false
type: boolean
description: release
env:
VERSION: 4.1.0
jobs:
lint_markdown_files:
uses: optimizely/swift-sdk/.github/workflows/lint_markdown.yml@master
integration_tests:
if: "${{ github.event.inputs.PREP == '' && github.event.inputs.RELEASE == '' }}"
uses: optimizely/swift-sdk/.github/workflows/integration_tests.yml@master
secrets:
CI_USER_TOKEN: ${{ secrets.CI_USER_TOKEN }}
TRAVIS_COM_TOKEN: ${{ secrets.TRAVIS_COM_TOKEN }}
lint:
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 14.1.0
- env:
SRCCLR_API_TOKEN: ${{ secrets.SRCCLR_API_TOKEN }}
run: |
gem install cocoapods -v '1.9.3'
pod spec lint --quick
curl -sSL https://download.sourceclear.com/ci.sh | bash
unittests:
if: "${{ github.event.inputs.PREP == '' && github.event.inputs.RELEASE == '' }}"
uses: optimizely/swift-sdk/.github/workflows/unit_tests.yml@master
prepare_for_release:
runs-on: macos-12
if: "${{ github.event.inputs.PREP == 'true' && github.event_name == 'workflow_dispatch' }}"
steps:
- uses: actions/checkout@v3
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 14.1.0
- name: Install Hub by Homebrew
run: |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install hub
- id: prepare_for_release
name: Prepare for release
env:
HOME: 'home/runner'
REPO_SLUG: ${{ github.repository }}
BRANCH: ${{ github.ref_name }}
GITHUB_USER: optibot
GITHUB_TOKEN: ${{ secrets.CI_USER_TOKEN }}
COCOAPODS_VERSION: '1.12.1'
run: |
gem install cocoapods -v $COCOAPODS_VERSION
Scripts/run_prep.sh
- name: Check prepare for release failure
if: steps.prepare_for_release.conclusion == 'failure'
run: cat /tmp/build.out
release:
if: "${{github.event.inputs.RELEASE == 'true' && github.event_name == 'workflow_dispatch' }}"
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 14.1.0
- name: Install Hub by Homebrew
run: |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install hub
- name: Push to cocoapods.org
env:
HOME: 'home/runner'
REPO_SLUG: ${{ github.repository }}
BRANCH: ${{ github.ref_name }}
GITHUB_TOKEN: ${{ secrets.CI_USER_TOKEN }}
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
COCOAPODS_VERSION: '1.12.1'
run: |
gem install cocoapods -v $COCOAPODS_VERSION
Scripts/run_release.sh