Skip to content

Commit 5c5e3e8

Browse files
committed
seprate out SPM and CocoaPods workflows
1 parent f6581a5 commit 5c5e3e8

File tree

4 files changed

+405
-360
lines changed

4 files changed

+405
-360
lines changed

.github/workflows/prerelease.yml

Lines changed: 1 addition & 194 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: prerelease
22

33
permissions:
4-
contents: write
4+
contents: read
55

66
on:
77
pull_request:
@@ -22,199 +22,6 @@ concurrency:
2222
cancel-in-progress: true
2323

2424
jobs:
25-
specs_checking:
26-
# Don't run on private repo unless it is a PR.
27-
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'workflow_dispatch'
28-
runs-on: macos-15
29-
env:
30-
botaccess: ${{ secrets.PRERELEASE_TESTING_PAT }}
31-
local_repo: specstesting
32-
podspec_repo_branch: main
33-
outputs:
34-
matrix: ${{ steps.generate_matrix.outputs.matrix }}
35-
steps:
36-
- name: Checkout code
37-
uses: actions/checkout@v4
38-
with:
39-
fetch-depth: 0
40-
- name: Xcode
41-
run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
42-
- name: Generate matrix
43-
id: generate_matrix
44-
run: |
45-
cd "${GITHUB_WORKSPACE}/ReleaseTooling"
46-
swift run manifest --sdk-repo-url "${GITHUB_WORKSPACE}" --output-file-path ./output.json --for-gha-matrix-generation
47-
echo "::set-output name=matrix::{\"include\":$( cat output.json )}"
48-
- name: Update SpecsTesting repo setup
49-
run: |
50-
podspec_repo_branch="${podspec_repo_branch}" \
51-
scripts/release_testing_setup.sh prerelease_testing
52-
env:
53-
BOT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54-
- name: Clean spec repo
55-
run: |
56-
git clone --quiet https://${botaccess}@github.com/Firebase/SpecsTesting.git "${local_repo}"
57-
cd "${local_repo}"
58-
# Remove all unhidden dirs, i.e. all podspec dir from the spec repo.
59-
rm -Rf -- */
60-
git add .
61-
# commit without diff will throw an error. `git diff --exit-code` can avoid such error.
62-
git diff --staged --exit-code || git commit -m "Empty spec repo."
63-
# Attempt to push. If it fails, print a detailed error message and exit.
64-
git push || {
65-
echo "--------------------------------------------------------------------------------"
66-
echo "ERROR: Failed to push to Firebase/SpecsTesting."
67-
echo "This is likely due to an expired Personal Access Token (PAT)."
68-
echo "Please take the following steps to resolve this:"
69-
echo "1. Refresh the OSS bot's scoped access token for the Firebase/SpecsTesting repo."
70-
echo " This can be done in the OSS bot's GitHub account settings. Ensure the token "
71-
echo " has the 'public_repo' scope."
72-
echo "2. Update the 'PRERELEASE_TESTING_PAT' secret in this repo's settings."
73-
echo " (https://github.com/Firebase/firebase-ios-sdk/settings/secrets/actions)"
74-
echo "--------------------------------------------------------------------------------"
75-
exit 1
76-
}
77-
- name: Clean Artifacts
78-
if: ${{ always() }}
79-
run: |
80-
rm -rf prerelease-testing-token.txt
81-
- uses: actions/upload-artifact@v4
82-
with:
83-
name: firebase-ios-sdk
84-
path: |
85-
*.podspec
86-
*.podspec.json
87-
88-
buildup_SpecsTesting_repo_FirebaseCore:
89-
needs: specs_checking
90-
# Don't run on private repo unless it is a PR.
91-
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'workflow_dispatch'
92-
runs-on: macos-15
93-
env:
94-
botaccess: ${{ secrets.PRERELEASE_TESTING_PAT }}
95-
local_repo: specstesting
96-
local_sdk_repo_dir: /tmp/test/firebase-ios-sdk
97-
targeted_pod: FirebaseCore
98-
steps:
99-
- uses: actions/checkout@v4
100-
- name: Xcode
101-
run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
102-
- uses: actions/[email protected]
103-
with:
104-
name: firebase-ios-sdk
105-
path: ${{ env.local_sdk_repo_dir }}
106-
# Addresses flaky pushes due to missing git config on runner.
107-
- name: Set git config
108-
run: |
109-
git config --global user.email "[email protected]"
110-
git config --global user.name "google-oss-bot"
111-
- name: Update SpecsTesting repo
112-
run: |
113-
cd scripts/create_spec_repo/
114-
swift build
115-
pod repo add --silent "${local_repo}" https://"$botaccess"@github.com/Firebase/SpecsTesting.git
116-
BOT_TOKEN="${botaccess}" ${GITHUB_WORKSPACE}/scripts/third_party/travis/retry.sh .build/debug/spec-repo-builder \
117-
--sdk-repo "${local_sdk_repo_dir}" \
118-
--local-spec-repo-name "${local_repo}" \
119-
--sdk-repo-name SpecsTesting \
120-
--github-account Firebase \
121-
--pod-sources 'https://${BOT_TOKEN}@github.com/Firebase/SpecsTesting' "https://github.com/firebase/SpecsDev.git" "https://github.com/firebase/SpecsStaging.git" "https://github.com/CocoaPods/Specs.git" \
122-
--include-pods "${targeted_pod}" --keep-repo
123-
- name: Clean Artifacts
124-
if: ${{ always() }}
125-
run: pod repo remove "${local_repo}"
126-
127-
buildup_SpecsTesting_repo:
128-
needs: [buildup_SpecsTesting_repo_FirebaseCore, specs_checking]
129-
# Don't run on private repo unless it is a PR.
130-
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'workflow_dispatch'
131-
runs-on: macos-15
132-
strategy:
133-
fail-fast: false
134-
matrix: ${{fromJson(needs.specs_checking.outputs.matrix)}}
135-
env:
136-
botaccess: ${{ secrets.PRERELEASE_TESTING_PAT }}
137-
local_repo: specstesting
138-
local_sdk_repo_dir: /tmp/test/firebase-ios-sdk
139-
targeted_pod: ${{ matrix.podspec }}
140-
steps:
141-
- uses: actions/checkout@v4
142-
- name: Xcode
143-
run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
144-
- uses: actions/[email protected]
145-
with:
146-
name: firebase-ios-sdk
147-
path: ${{ env.local_sdk_repo_dir }}
148-
# Addresses flaky pushes due to missing git config on runner.
149-
- name: Set git config
150-
run: |
151-
git config --global user.email "[email protected]"
152-
git config --global user.name "google-oss-bot"
153-
- name: Update SpecsTesting repo
154-
run: |
155-
[[ ${{ matrix.allowwarnings }} == true ]] && ALLOWWARNINGS=true
156-
cd scripts/create_spec_repo/
157-
swift build
158-
pod repo add --silent "${local_repo}" https://"$botaccess"@github.com/Firebase/SpecsTesting.git
159-
# ${ALLOWWARNINGS:+--allow-warnings} will add --allow-warnings to the
160-
# command if ${ALLOWWARNINGS} is not null.
161-
BOT_TOKEN="${botaccess}" ${GITHUB_WORKSPACE}/scripts/third_party/travis/retry.sh .build/debug/spec-repo-builder \
162-
--sdk-repo "${local_sdk_repo_dir}" \
163-
--local-spec-repo-name "${local_repo}" \
164-
--sdk-repo-name SpecsTesting \
165-
--github-account Firebase \
166-
--pod-sources 'https://${BOT_TOKEN}@github.com/Firebase/SpecsTesting' "https://github.com/firebase/SpecsDev.git" "https://github.com/firebase/SpecsStaging.git" "https://github.com/CocoaPods/Specs.git" \
167-
--include-pods "${targeted_pod}" \
168-
--keep-repo ${ALLOWWARNINGS:+--allow-warnings}
169-
- name: Clean Artifacts
170-
if: ${{ always() }}
171-
run: pod repo remove "${local_repo}"
172-
173-
update_SpecsTesting_repo:
174-
# Don't run on private repo unless it is a PR.
175-
if: github.repository == 'Firebase/firebase-ios-sdk' && github.event.pull_request.merged == true
176-
runs-on: macos-15
177-
env:
178-
botaccess: ${{ secrets.PRERELEASE_TESTING_PAT }}
179-
local_repo: specstesting
180-
podspec_repo_branch: main
181-
steps:
182-
- uses: actions/checkout@v4
183-
with:
184-
fetch-depth: 0
185-
- name: Xcode
186-
run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
187-
- name: Update SpecsTesting repo setup
188-
run: |
189-
# Update/create a nightly tag to the head of the main branch.
190-
podspec_repo_branch="${podspec_repo_branch}" \
191-
scripts/release_testing_setup.sh prerelease_testing
192-
env:
193-
BOT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
194-
- name: Push updated podspecs
195-
run: |
196-
# Changes in post submit tests will be fetched by getting diff between
197-
# the HEAD and HEAD^ of the main branch.
198-
common_commit=$(git rev-parse HEAD^)
199-
git diff --name-only $common_commit remotes/origin/${podspec_repo_branch} > updated_files.txt
200-
updated_podspecs=()
201-
while IFS= read -r line;
202-
do
203-
echo $line
204-
if [ ${line: -8} == ".podspec" ]
205-
then
206-
updated_podspecs+=("$(basename -s .podspec ${line})")
207-
fi
208-
done < updated_files.txt
209-
if [ -z "$updated_podspecs" ]
210-
then
211-
exit
212-
fi
213-
cd scripts/create_spec_repo/
214-
swift build
215-
pod repo add --silent "${local_repo}" https://"$botaccess"@github.com/Firebase/SpecsTesting.git
216-
BOT_TOKEN="${botaccess}" .build/debug/spec-repo-builder --sdk-repo $(pwd) --local-spec-repo-name "${local_repo}" --sdk-repo-name SpecsTesting --github-account Firebase --pod-sources 'https://${BOT_TOKEN}@github.com/Firebase/SpecsTesting' "https://github.com/firebase/SpecsDev.git" "https://github.com/firebase/SpecsStaging.git" "https://cdn.cocoapods.org/" "FirebaseFirestoreTestingSupport" "FirebaseAuthTestingSupport" "FirebaseCombineSwift" --keep-repo --include-pods "${updated_podspecs[@]}"
217-
21825
# TODO: The functions quickstart uses Material which isn't supported by Xcode 15
21926
#functions_quickstart:
22027
# Don't run on private repo unless it is a PR.

0 commit comments

Comments
 (0)