Skip to content

Commit 3c4ca84

Browse files
committed
ci: add CI/CD pipeline actions
1 parent 498d763 commit 3c4ca84

File tree

3 files changed

+143
-0
lines changed

3 files changed

+143
-0
lines changed

.github/FUNDING.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# These are supported funding model platforms
2+
3+
github: [soumyamahunt] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4+
patreon: # Replace with a single Patreon username
5+
open_collective: # Replace with a single Open Collective username
6+
ko_fi: # Replace with a single Ko-fi username
7+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
liberapay: # Replace with a single Liberapay username
10+
issuehunt: # Replace with a single IssueHunt username
11+
otechie: # Replace with a single Otechie username
12+
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
13+
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

.github/dependabot.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
version: 2
2+
enable-beta-ecosystems: true
3+
updates:
4+
# - package-ecosystem: swift-package
5+
# directory: /
6+
# schedule:
7+
# interval: weekly
8+
# commit-message:
9+
# prefix: 'deps: '
10+
11+
- package-ecosystem: github-actions
12+
directory: /
13+
schedule:
14+
interval: monthly
15+
commit-message:
16+
prefix: 'ci(Deps): '
17+
18+
- package-ecosystem: npm
19+
directory: /
20+
schedule:
21+
interval: monthly
22+
commit-message:
23+
prefix: 'ci(Deps): '

.github/workflows/main.yml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: CI/CD
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
schedule:
9+
- cron: '0 0 * * *'
10+
workflow_dispatch:
11+
inputs:
12+
release:
13+
description: Create release
14+
required: false
15+
type: boolean
16+
version:
17+
description: New version to release
18+
required: false
19+
type: string
20+
21+
concurrency:
22+
group: ci/cd-${{ github.ref }}
23+
cancel-in-progress: true
24+
25+
jobs:
26+
analyze:
27+
name: Analyze
28+
if: github.event_name != 'workflow_dispatch'
29+
uses: SwiftyLab/ci/.github/workflows/analyze.yml@main
30+
permissions:
31+
actions: read
32+
contents: read
33+
security-events: write
34+
with:
35+
matrix: >
36+
{
37+
"include": [
38+
{
39+
"os": "ubuntu-latest",
40+
"language": "swift",
41+
"swift": "5.9"
42+
},
43+
{
44+
"os": "macos-13",
45+
"language": "swift",
46+
"xcode": "15"
47+
}
48+
]
49+
}
50+
51+
# spell-check:
52+
# name: Run spell check
53+
# runs-on: ubuntu-latest
54+
# steps:
55+
# - name: Checkout repository
56+
# uses: actions/checkout@v3
57+
58+
# - name: Spellcheck Action
59+
# uses: rojopolis/[email protected]
60+
# with:
61+
# config_path: .github/config/spellcheck.yml
62+
63+
swift-package-test:
64+
name: Swift Package
65+
uses: SwiftyLab/ci/.github/workflows/swift-package.yml@main
66+
secrets: inherit
67+
with:
68+
matrix: >
69+
{
70+
"include": [
71+
{
72+
"os": "ubuntu-latest",
73+
"swift": "5.9"
74+
},
75+
{
76+
"os": ""macos-13",
77+
"xcode": "15"
78+
}
79+
]
80+
}
81+
# {
82+
# "os": "windows-latest",
83+
# "swift": "5.9"
84+
# }
85+
86+
ci:
87+
name: CI
88+
if: github.event_name == 'push'
89+
needs: [analyze, swift-package-test]
90+
uses: SwiftyLab/ci/.github/workflows/ci.yml@main
91+
92+
cd:
93+
name: CD
94+
if: |
95+
(github.event_name == 'push' && needs.ci.outputs.release == 'true') ||
96+
(always() &&
97+
github.event_name == 'workflow_dispatch' &&
98+
github.event.inputs.release == 'true' &&
99+
needs.swift-package-test.result == 'success' &&
100+
(needs.ci.result == 'success' || needs.ci.result == 'skipped') &&
101+
(needs.analyze.result == 'success' || needs.analyze.result == 'skipped'))
102+
needs: [analyze, swift-package-test, ci]
103+
uses: SwiftyLab/ci/.github/workflows/cd.yml@main
104+
with:
105+
version: ${{ github.event.inputs.version }}
106+
secrets:
107+
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}

0 commit comments

Comments
 (0)