diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 637b5a7a87e1..36d7f7ee2fa9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,29 +20,21 @@ jobs: strategy: matrix: command: [test, ''] - platform: [IOS, MACOS] + platform: [iOS, macOS] xcode: ['16.2'] steps: - uses: actions/checkout@v4 - - name: Select Xcode ${{ matrix.xcode }} - run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app - - name: List available devices - run: xcrun simctl list devices available - - name: Cache derived data - uses: actions/cache@v3 - with: - path: | - ~/.derivedData - key: | - deriveddata-xcodebuild-${{ matrix.platform }}-${{ matrix.xcode }}-${{ matrix.command }}-${{ hashFiles('**/Sources/**/*.swift', '**/Tests/**/*.swift') }} - restore-keys: | - deriveddata-xcodebuild-${{ matrix.platform }}-${{ matrix.xcode }}-${{ matrix.command }}- - - name: Set IgnoreFileSystemDeviceInodeChanges flag - run: defaults write com.apple.dt.XCBuild IgnoreFileSystemDeviceInodeChanges -bool YES - - name: Update mtime for incremental builds - uses: chetan/git-restore-mtime-action@v2 - name: Debug - run: make XCODEBUILD_ARGUMENT="${{ matrix.command }}" CONFIG=Debug PLATFORM="${{ matrix.platform }}" WORKSPACE=.github/package.xcworkspace xcodebuild + uses: capturecontext/swift-package-action@2.0 + with: + xcode: ${{ matrix.xcode }} + cache-derived-data: true + command: xcodebuild + subcommand: ${{ matrix.command }} + platform: ${{ matrix.platform }} + workspace: .github/package.xcworkspace + scheme: ComposableArchitecture + config: Debug xcodebuild: name: xcodebuild (15) @@ -50,7 +42,7 @@ jobs: strategy: matrix: command: [test, ''] - platform: [IOS, MAC_CATALYST, MACOS, TVOS, VISIONOS, WATCHOS] + platform: [iOS, macOS, macCatalyst, tvOS, visionOS, watchOS] xcode: [15.2, 15.4] exclude: - {xcode: 15.2, command: test} @@ -63,81 +55,111 @@ jobs: - {xcode: 15.2, skip_release: 1} steps: - uses: actions/checkout@v4 - - name: Select Xcode ${{ matrix.xcode }} - run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app - - name: Install visionOS runtime - if: matrix.platform == 'visionOS' - run: | - sudo xcodebuild -runFirstLaunch - sudo xcrun simctl list - sudo xcodebuild -downloadPlatform visionOS - sudo xcodebuild -runFirstLaunch - - name: List available devices - run: xcrun simctl list devices available - - name: Cache derived data - uses: actions/cache@v3 - with: - path: | - ~/.derivedData - key: | - deriveddata-xcodebuild-${{ matrix.platform }}-${{ matrix.xcode }}-${{ matrix.command }}-${{ hashFiles('**/Sources/**/*.swift', '**/Tests/**/*.swift') }} - restore-keys: | - deriveddata-xcodebuild-${{ matrix.platform }}-${{ matrix.xcode }}-${{ matrix.command }}- - - name: Set IgnoreFileSystemDeviceInodeChanges flag - run: defaults write com.apple.dt.XCBuild IgnoreFileSystemDeviceInodeChanges -bool YES - - name: Update mtime for incremental builds - uses: chetan/git-restore-mtime-action@v2 - name: Debug - run: make XCODEBUILD_ARGUMENT="${{ matrix.command }}" CONFIG=Debug PLATFORM="${{ matrix.platform }}" WORKSPACE=.github/package.xcworkspace xcodebuild + uses: capturecontext/swift-package-action@2.0 + with: + xcode: ${{ matrix.xcode }} + cache-derived-data: true + command: xcodebuild + subcommand: ${{ matrix.command }} + platform: ${{ matrix.platform }} + workspace: .github/package.xcworkspace + scheme: ComposableArchitecture + config: Debug - name: Release if: matrix.skip_release != '1' - run: make XCODEBUILD_ARGUMENT="${{ matrix.command }}" CONFIG=Release PLATFORM="${{ matrix.platform }}" WORKSPACE=.github/package.xcworkspace xcodebuild + uses: capturecontext/swift-package-action@2.0 + with: + xcode: ${{ matrix.xcode }} + cache-derived-data: true + command: xcodebuild + subcommand: ${{ matrix.command }} + platform: ${{ matrix.platform }} + workspace: .github/package.xcworkspace + scheme: ComposableArchitecture + config: Release library-evolution: name: Library (evolution) runs-on: macos-14 steps: - uses: actions/checkout@v4 - - name: Select Xcode 15.4 - run: sudo xcode-select -s /Applications/Xcode_15.4.app - name: Build for library evolution - run: make build-for-library-evolution + uses: capturecontext/swift-package-action@2.0 + with: + xcode: 15.4 + command: build-for-library-evolution + scheme: ComposableArchitecture examples: name: Examples runs-on: macos-15 steps: - uses: actions/checkout@v4 - - name: Cache derived data - uses: actions/cache@v3 - with: - path: ~/.derivedData - key: | - deriveddata-examples-${{ hashFiles('**/Sources/**/*.swift', '**/Tests/**/*.swift', '**/Examples/**/*.swift') }} - restore-keys: | - deriveddata-examples- - - name: Select Xcode 16 - run: sudo xcode-select -s /Applications/Xcode_16.2.app - - name: Set IgnoreFileSystemDeviceInodeChanges flag - run: defaults write com.apple.dt.XCBuild IgnoreFileSystemDeviceInodeChanges -bool YES - - name: Update mtime for incremental builds - uses: chetan/git-restore-mtime-action@v2 - name: CaseStudies (SwiftUI) - run: make DERIVED_DATA_PATH=~/.derivedData SCHEME="CaseStudies (SwiftUI)" xcodebuild + uses: capturecontext/swift-package-action@2.0 + with: + command: xcodebuild-raw + cache-derived-data: true + workspace: ComposableArchitecture.xcworkspace + scheme: CaseStudies (SwiftUI) + platform: iOS - name: CaseStudies (UIKit) - run: make DERIVED_DATA_PATH=~/.derivedData SCHEME="CaseStudies (UIKit)" xcodebuild + uses: capturecontext/swift-package-action@2.0 + with: + command: xcodebuild-raw + cache-derived-data: true + workspace: ComposableArchitecture.xcworkspace + scheme: CaseStudies (UIKit) + platform: iOS - name: Search - run: make DERIVED_DATA_PATH=~/.derivedData SCHEME="Search" xcodebuild + uses: capturecontext/swift-package-action@2.0 + with: + command: xcodebuild-raw + cache-derived-data: true + workspace: ComposableArchitecture.xcworkspace + scheme: Search + platform: iOS - name: SyncUps - run: make DERIVED_DATA_PATH=~/.derivedData SCHEME="SyncUps" xcodebuild + uses: capturecontext/swift-package-action@2.0 + with: + command: xcodebuild-raw + cache-derived-data: true + workspace: ComposableArchitecture.xcworkspace + scheme: SyncUps + platform: iOS - name: SpeechRecognition - run: make DERIVED_DATA_PATH=~/.derivedData SCHEME="SpeechRecognition" xcodebuild + uses: capturecontext/swift-package-action@2.0 + with: + command: xcodebuild-raw + cache-derived-data: true + workspace: ComposableArchitecture.xcworkspace + scheme: SpeechRecognition + platform: iOS - name: TicTacToe - run: make DERIVED_DATA_PATH=~/.derivedData SCHEME="TicTacToe" xcodebuild + uses: capturecontext/swift-package-action@2.0 + with: + command: xcodebuild-raw + cache-derived-data: true + workspace: ComposableArchitecture.xcworkspace + scheme: TicTacToe + platform: iOS - name: Todos - run: make DERIVED_DATA_PATH=~/.derivedData SCHEME="Todos" xcodebuild + uses: capturecontext/swift-package-action@2.0 + with: + command: xcodebuild-raw + cache-derived-data: true + workspace: ComposableArchitecture.xcworkspace + scheme: Todos + platform: iOS - name: VoiceMemos - run: make DERIVED_DATA_PATH=~/.derivedData SCHEME="VoiceMemos" xcodebuild + uses: capturecontext/swift-package-action@2.0 + with: + command: xcodebuild-raw + cache-derived-data: true + workspace: ComposableArchitecture.xcworkspace + scheme: VoiceMemos + platform: iOS check-macro-compatibility: name: Check Macro Compatibility diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml deleted file mode 100644 index 175fe9a15b96..000000000000 --- a/.github/workflows/documentation.yml +++ /dev/null @@ -1,74 +0,0 @@ -# Build and deploy DocC to GitHub pages. Based off of @karwa's work here: -# https://github.com/karwa/swift-url/blob/main/.github/workflows/docs.yml -name: Documentation - -on: - release: - types: - - published - push: - branches: - - main - workflow_dispatch: - -concurrency: - group: docs-${{ github.ref }} - cancel-in-progress: true - -jobs: - build: - runs-on: macos-15 - steps: - - name: Select Xcode 16.2 - run: sudo xcode-select -s /Applications/Xcode_16.2.app - - - name: Checkout Package - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Checkout gh-pages Branch - uses: actions/checkout@v4 - with: - ref: gh-pages - path: docs-out - - - name: Build documentation - run: > - rm -rf docs-out/.git; - rm -rf docs-out/main; - git tag -l --sort=-v:refname | grep -e "\d\+\.\d\+.0" | tail -n +6 | xargs -I {} rm -rf {}; - - for tag in $(echo "main"; git tag -l --sort=-v:refname | grep -e "\d\+\.\d\+.0" | head -6); - do - if [ -d "docs-out/$tag/data/documentation/composablearchitecture" ] - then - echo "✅ Documentation for "$tag" already exists."; - else - echo "⏳ Generating documentation for ComposableArchitecture @ "$tag" release."; - rm -rf "docs-out/$tag"; - - git checkout .; - git checkout "$tag"; - - swift package \ - --allow-writing-to-directory docs-out/"$tag" \ - generate-documentation \ - --target ComposableArchitecture \ - --output-path docs-out/"$tag" \ - --transform-for-static-hosting \ - --hosting-base-path /swift-composable-architecture/"$tag" \ - && echo "✅ Documentation generated for ComposableArchitecture @ "$tag" release." \ - || echo "⚠️ Documentation skipped for ComposableArchitecture @ "$tag"."; - fi; - done - - - name: Fix permissions - run: 'sudo chown -R $USER docs-out' - - - name: Publish documentation to GitHub Pages - uses: JamesIves/github-pages-deploy-action@4.1.7 - with: - branch: gh-pages - folder: docs-out - single-commit: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 23a4e9495454..000000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,83 +0,0 @@ -name: Release -on: - release: - types: [published] - workflow_dispatch: -jobs: - project-channel: - runs-on: ubuntu-latest - steps: - - name: Dump Github context - env: - GITHUB_CONTEXT: ${{ toJSON(github) }} - run: echo "$GITHUB_CONTEXT" - - name: Slack Notification on SUCCESS - if: success() - uses: tokorom/action-slack-incoming-webhook@main - env: - INCOMING_WEBHOOK_URL: ${{ secrets.SLACK_PROJECT_CHANNEL_WEBHOOK_URL }} - with: - text: swift-composable-architecture ${{ github.event.release.tag_name }} has been released. - blocks: | - [ - { - "type": "header", - "text": { - "type": "plain_text", - "text": "swift-composable-architecture ${{ github.event.release.tag_name}}" - } - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": ${{ toJSON(github.event.release.body) }} - } - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "${{ github.event.release.html_url }}" - } - } - ] - - releases-channel: - runs-on: ubuntu-latest - steps: - - name: Dump Github context - env: - GITHUB_CONTEXT: ${{ toJSON(github) }} - run: echo "$GITHUB_CONTEXT" - - name: Slack Notification on SUCCESS - if: success() - uses: tokorom/action-slack-incoming-webhook@main - env: - INCOMING_WEBHOOK_URL: ${{ secrets.SLACK_RELEASES_WEBHOOK_URL }} - with: - text: swift-composable-architecture ${{ github.event.release.tag_name }} has been released. - blocks: | - [ - { - "type": "header", - "text": { - "type": "plain_text", - "text": "swift-composable-architecture ${{ github.event.release.tag_name}}" - } - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": ${{ toJSON(github.event.release.body) }} - } - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "${{ github.event.release.html_url }}" - } - } - ] diff --git a/README.md b/README.md index 972931c27676..23a904fabed4 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# The Composable Architecture +# The Composable Architecture [test-pr] [![CI](https://github.com/pointfreeco/swift-composable-architecture/workflows/CI/badge.svg)](https://github.com/pointfreeco/swift-composable-architecture/actions?query=workflow%3ACI) [![Slack](https://img.shields.io/badge/slack-chat-informational.svg?label=Slack&logo=slack)](https://www.pointfree.co/slack-invite)