-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run PR Checks while bumping internal release
- Loading branch information
Showing
3 changed files
with
63 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,12 +10,12 @@ on: | |
|
||
jobs: | ||
|
||
increment_build_number: | ||
update_embedded_files: | ||
|
||
name: Increment Build Number | ||
name: Update Embedded Files | ||
|
||
runs-on: macos-13 | ||
timeout-minutes: 60 | ||
timeout-minutes: 10 | ||
|
||
steps: | ||
|
||
|
@@ -31,34 +31,52 @@ jobs: | |
with: | ||
submodules: recursive | ||
|
||
- name: Set cache key hash | ||
- name: Select Xcode | ||
run: sudo xcode-select -s /Applications/Xcode_$(<.xcode-version).app/Contents/Developer | ||
|
||
- name: Prepare fastlane | ||
run: bundle install | ||
|
||
- name: Update embedded files | ||
env: | ||
APPLE_API_KEY_BASE64: ${{ secrets.APPLE_API_KEY_BASE64 }} | ||
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }} | ||
APPLE_API_KEY_ISSUER: ${{ secrets.APPLE_API_KEY_ISSUER }} | ||
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 | ||
git config --global user.name "Dax the Duck" | ||
git config --global user.email "[email protected]" | ||
bundle exec fastlane update_embedded_files | ||
run_tests: | ||
|
||
name: Run Tests | ||
|
||
needs: update_embedded_files | ||
uses: ./.github/workflows/pr.yml | ||
secrets: | ||
ASANA_ACCESS_TOKEN: ${{ secrets.ASANA_ACCESS_TOKEN }} | ||
|
||
increment_build_number: | ||
|
||
name: Increment Build Number | ||
|
||
needs: run_tests | ||
runs-on: macos-13 | ||
timeout-minutes: 10 | ||
|
||
steps: | ||
|
||
- name: Check out the code | ||
uses: actions/checkout@v3 | ||
with: | ||
path: DerivedData/SourcePackages | ||
key: ${{ runner.os }}-spm-Non-Sandbox-${{ env.cache_key_hash }} | ||
restore-keys: | | ||
${{ runner.os }}-spm-Non-Sandbox | ||
submodules: recursive | ||
|
||
- name: Select Xcode | ||
run: sudo xcode-select -s /Applications/Xcode_$(<.xcode-version).app/Contents/Developer | ||
|
||
- name: Prepare fastlane | ||
run: bundle install | ||
|
||
- name: Install xcbeautify | ||
continue-on-error: true | ||
run: brew install xcbeautify | ||
|
||
- name: Increment build number | ||
env: | ||
APPLE_API_KEY_BASE64: ${{ secrets.APPLE_API_KEY_BASE64 }} | ||
|
@@ -67,9 +85,10 @@ jobs: | |
run: | | ||
git config --global user.name "Dax the Duck" | ||
git config --global user.email "[email protected]" | ||
bundle exec fastlane bump_internal_release | ||
bundle exec fastlane bump_internal_release update_embedded_files:false | ||
prepare_release: | ||
name: Prepare Release | ||
needs: increment_build_number | ||
uses: ./.github/workflows/release.yml | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,10 @@ on: | |
push: | ||
branches: [ main, "release/**" ] | ||
pull_request: | ||
|
||
workflow_call: | ||
secrets: | ||
ASANA_ACCESS_TOKEN: | ||
required: true | ||
|
||
jobs: | ||
swiftlint: | ||
|
@@ -79,13 +82,6 @@ jobs: | |
commit_author: ${{ steps.fetch_commit_author.outputs.commit_author }} | ||
|
||
steps: | ||
- name: Register SSH keys for submodules access | ||
uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: | | ||
${{ secrets.SSH_PRIVATE_KEY_FIND_IN_PAGE }} | ||
${{ secrets.SSH_PRIVATE_KEY_PRIVACY_DASHBOARD }} | ||
- name: Check out the code | ||
uses: actions/checkout@v3 | ||
with: | ||
|
@@ -248,7 +244,8 @@ jobs: | |
name: Make Release Build | ||
|
||
# Dependabot doesn't have access to all secrets, so we skip this job | ||
if: github.actor != 'dependabot[bot]' | ||
# workflow_call is used by bump_internal_release and is followed by a proper release job | ||
if: ${{ github.actor != 'dependabot[bot]' && github.event_name != 'workflow_call' }} | ||
|
||
strategy: | ||
matrix: | ||
|
@@ -258,13 +255,6 @@ jobs: | |
timeout-minutes: 30 | ||
|
||
steps: | ||
- name: Register SSH keys for submodules access | ||
uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: | | ||
${{ secrets.SSH_PRIVATE_KEY_FIND_IN_PAGE }} | ||
${{ secrets.SSH_PRIVATE_KEY_PRIVACY_DASHBOARD }} | ||
- name: Check out the code | ||
uses: actions/checkout@v3 | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters