Skip to content

CI/CD

CI/CD #641

Workflow file for this run

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/analyze.yml@main
permissions:
actions: read
contents: read
security-events: write
with:
matrix: >
{
"include": [
{
"os": "ubuntu-latest",
"language": "swift",
"swift": "latest"
},
{
"os": "macos-13",
"language": "swift",
"xcode": "latest"
}
]
}
spell-check:
name: Run spell check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Spellcheck Action
uses: rojopolis/spellcheck-github-actions@0.41.0
with:
config_path: .github/config/spellcheck.yaml
swift-package-test:
name: Swift Package
uses: SwiftyLab/ci/.github/workflows/swift-package.yml@main
secrets: inherit
with:
matrix: >
{
"include": [
{
"os": "ubuntu-latest",
"swift": "latest"
},
{
"os": "macos-13",
"xcode": "latest"
}
]
}
cocoapods-test:
name: CocoaPods
uses: SwiftyLab/ci/.github/workflows/cocoapods.yml@main
strategy:
matrix:
platforms: ['macos tvos', 'ios']
with:
os: macos-13
xcode: latest
platforms: ${{ matrix.platforms }}
ci:
name: CI
if: github.event_name == 'push'
needs: [analyze, spell-check, swift-package-test, cocoapods-test]
uses: SwiftyLab/ci/.github/workflows/ci.yml@main
cd:
name: CD
if: |
always() &&
github.event_name == 'workflow_dispatch' &&
github.event.inputs.release == 'true' &&
(needs.ci.result == 'success' || needs.ci.result == 'skipped') &&
(needs.swift-package-test.result == 'success' || needs.swift-package-test.result == 'skipped') &&
(needs.cocoapods-test.result == 'success' || needs.cocoapods-test.result == 'skipped')
needs: [analyze, spell-check, swift-package-test, cocoapods-test, ci]
uses: SwiftyLab/ci/.github/workflows/cd.yml@main
with:
version: ${{ github.event.inputs.version }}
secrets:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}