Skip to content

CI/CD

CI/CD #754

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-latest",
"language": "swift",
"swift": "6.0.0"
}
]
}
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.44.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",
"swift": "5.9"
},
{
"os": "macos-latest",
"swift": "6.0.0"
}
]
}
cocoapods-test:
name: CocoaPods
uses: SwiftyLab/ci/.github/workflows/cocoapods.yml@main
strategy:
matrix:
platform: ['macOS', 'iOS']
with:
os: macos-latest
swift: 6.0.0
platforms: ${{ matrix.platform }}
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:
swift: '6.0.0'
version: ${{ github.event.inputs.version }}
secrets:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}