diff --git a/.github/workflows/bump_internal_release.yml b/.github/workflows/bump_internal_release.yml index 3d5d15623b..e97e92b0f4 100644 --- a/.github/workflows/bump_internal_release.yml +++ b/.github/workflows/bump_internal_release.yml @@ -31,6 +31,24 @@ jobs: with: submodules: recursive + - name: Set cache key hash + run: | + has_only_tags=$(jq '[ .pins[].state | has("version") ] | all' DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved) + if [[ "$has_only_tags" == "true" ]]; then + echo "cache_key_hash=${{ hashFiles('DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved') }}" >> $GITHUB_ENV + else + echo "Package.resolved contains dependencies specified by branch or commit, skipping cache." + fi + + - name: Cache SPM + if: env.cache_key_hash + uses: actions/cache@v3 + with: + path: DerivedData/SourcePackages + key: ${{ runner.os }}-spm-Non-Sandbox-${{ env.cache_key_hash }} + restore-keys: | + ${{ runner.os }}-spm-Non-Sandbox + - name: Select Xcode run: sudo xcode-select -s /Applications/Xcode_$(<.xcode-version).app/Contents/Developer @@ -51,7 +69,8 @@ jobs: git config --global user.email "dax@duckduckgo.com" bundle exec fastlane bump_internal_release - - name: Prepare new release - uses: ./.github/workflows/release.yml - with: - asana-task-url: ${{ github.event.inputs.asana-task-url }} + prepare_release: + needs: increment_build_number + uses: ./.github/workflows/release.yml + with: + asana-task-url: ${{ github.event.inputs.asana-task-url }}