This repository has been archived by the owner on Jan 11, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2
114 lines (105 loc) · 2.95 KB
/
main.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
name: CI/CD
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
inputs:
release:
description: Create release
required: false
type: boolean
version:
description: New version to release
required: false
type: string
concurrency:
group: ci/cd-${{ github.ref }}
cancel-in-progress: true
jobs:
# analyze:
# name: Analyze
# if: github.event_name != 'workflow_dispatch'
# uses: SwiftyLab/ci/.github/workflows/codeql-analysis.yml@main
# permissions:
# actions: read
# contents: read
# security-events: write
spell-check:
name: Run spell check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Spellcheck Action
uses: rojopolis/[email protected]
with:
config_path: .github/config/spellcheck.yml
swift-package-test:
name: Swift Package
uses: SwiftyLab/ci/.github/workflows/swift-package.yml@main
secrets: inherit
with:
matrix: >
{
"include": [
{
"os": "ubuntu-latest",
"swift": "5.7"
},
{
"os": "ubuntu-20.04",
"swift": "5.2"
}
]
}
# {
# "os": "windows-latest",
# "swift": "5.7"
# },
# {
# "os": "windows-latest",
# "swift": "5.3"
# }
cocoapods-test:
name: CocoaPods
uses: SwiftyLab/ci/.github/workflows/cocoapods.yml@main
strategy:
matrix:
platforms: ['macos tvos', 'ios']
with:
platforms: ${{ matrix.platforms }}
xcode-test:
name: Xcode
uses: SwiftyLab/ci/.github/workflows/xcode.yml@main
with:
os: macos-11
xcode: '11.7'
ci:
name: CI
if: github.event_name == 'push'
needs: [swift-package-test, xcode-test, cocoapods-test, spell-check]
# needs: [analyze, swift-package-test, xcode-test, cocoapods-test]
uses: SwiftyLab/ci/.github/workflows/ci.yml@main
cd:
name: CD
if: |
(github.event_name == 'push' && needs.ci.outputs.release == 'true') ||
(always() &&
github.event_name == 'workflow_dispatch' &&
github.event.inputs.release == 'true' &&
needs.swift-package-test.result == 'success' &&
needs.xcode-test.result == 'success' &&
needs.cocoapods-test.result == 'success' &&
(needs.ci.result == 'success' || needs.ci.result == 'skipped'))
# (needs.analyze.result == 'success' || needs.analyze.result == 'skipped')
needs: [ci, swift-package-test, xcode-test, cocoapods-test, spell-check]
# needs: [ci, analyze, swift-package-test, xcode-test, cocoapods-test]
uses: SwiftyLab/ci/.github/workflows/cd.yml@main
with:
version: ${{ github.event.inputs.version }}
secrets:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}