Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/testflight-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,22 @@ jobs:
with:
xcode-version: latest-stable

- name: Resolve Xcode cache key
id: xcode-cache
if: ${{ !inputs.dry_run }}
shell: bash
run: |
set -euo pipefail
xcode_key="$(xcodebuild -version | tr '\n' '-' | sed -E 's/[^A-Za-z0-9._-]+/-/g; s/-$//')"
echo "version=$xcode_key" >> "$GITHUB_OUTPUT"

- name: Restore Swift package cache
if: ${{ !inputs.dry_run }}
uses: actions/cache/restore@v4
with:
path: ${{ vars.IOS_WORKDIR || 'ios' }}/SourcePackages
key: spm-${{ runner.os }}-${{ runner.arch }}-${{ steps.xcode-cache.outputs.version }}-${{ hashFiles('ios/epac.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved') }}

- name: Set up Ruby and Bundler
if: ${{ !inputs.dry_run }}
uses: ruby/setup-ruby@v1
Expand Down Expand Up @@ -159,6 +175,7 @@ jobs:
NEW_VERSION: ${{ github.event_name == 'workflow_dispatch' && inputs.version_override || steps.version.outputs.next_version }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
APPLE_TEAM_ID: ${{ vars.APPLE_TEAM_ID }}
SPM_CLONED_SOURCE_PACKAGES_PATH: SourcePackages
run: |
bundle exec fastlane deploy \
scheme:${{ vars.SCHEME }} \
Expand Down
71 changes: 71 additions & 0 deletions .github/workflows/warm-spm-cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Warm Swift Package Cache

on:
workflow_dispatch:
push:
branches: [main]
paths:
- 'ios/epac.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved'
- '.github/workflows/warm-spm-cache.yml'

permissions:
contents: read

concurrency:
group: warm-spm-cache
cancel-in-progress: true

jobs:
warm:
name: Warm Swift package cache
runs-on: macos-15
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Select Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable

- name: Resolve Xcode cache key
id: xcode-cache
shell: bash
run: |
set -euo pipefail
xcode_key="$(xcodebuild -version | tr '\n' '-' | sed -E 's/[^A-Za-z0-9._-]+/-/g; s/-$//')"
echo "version=$xcode_key" >> "$GITHUB_OUTPUT"

- name: Restore Swift package cache
id: spm-cache
uses: actions/cache/restore@v4
with:
path: ios/SourcePackages
key: spm-${{ runner.os }}-${{ runner.arch }}-${{ steps.xcode-cache.outputs.version }}-${{ hashFiles('ios/epac.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved') }}

- name: Resolve Swift packages
if: ${{ steps.spm-cache.outputs.cache-hit != 'true' }}
run: |
xcodebuild -resolvePackageDependencies \
-project ios/epac.xcodeproj \
-scheme epac \
-configuration Release \
-clonedSourcePackagesDirPath ios/SourcePackages

- name: Save Swift package cache
if: ${{ steps.spm-cache.outputs.cache-hit != 'true' }}
uses: actions/cache/save@v4
with:
path: ios/SourcePackages
key: spm-${{ runner.os }}-${{ runner.arch }}-${{ steps.xcode-cache.outputs.version }}-${{ hashFiles('ios/epac.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved') }}

- name: Summary
run: |
{
echo "## Swift package cache"
echo ""
echo "- Xcode key: ${{ steps.xcode-cache.outputs.version }}"
echo "- Cache hit: ${{ steps.spm-cache.outputs.cache-hit || 'false' }}"
echo "- Path: ios/SourcePackages"
} >> "$GITHUB_STEP_SUMMARY"
1 change: 1 addition & 0 deletions ios/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ platform :ios do
configuration: "Release",
export_method: "app-store",
xcargs: extra_xcargs,
cloned_source_packages_path: ENV["SPM_CLONED_SOURCE_PACKAGES_PATH"],
output_directory: "build",
output_name: "epac.ipa",
clean: false
Expand Down
Loading