Skip to content

Commit

Permalink
GHA zip workflow: add manual trigger (#7450)
Browse files Browse the repository at this point in the history
* GHA zip workflow: add manual trigger

* avoid env

* Wrap URL

* temp enable for pull requests

* Revert package on pull request

* allow conditional steps for manual trigger
  • Loading branch information
maksymmalyhin authored Feb 4, 2021
1 parent 5e76aa9 commit 7ecc4a7
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 16 deletions.
33 changes: 20 additions & 13 deletions .github/workflows/zip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,17 @@ on:
# Run every day at midnight(PST) - cron uses UTC times
- cron: '0 8 * * *'

workflow_dispatch:
inputs:
custom_spec_repos:
description: 'Custom Podspec repos'
required: true
default: 'https://cpdc-internal.git.corp.google.com/firebase.git'

jobs:
build:
# Don't run on private repo unless it is a PR.
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
runs-on: macOS-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -27,7 +34,7 @@ jobs:
package:
# Don't run on private repo.
if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
if: (github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk') || github.event_name == 'workflow_dispatch'
needs: build
runs-on: macOS-latest
steps:
Expand All @@ -37,7 +44,7 @@ jobs:
- name: ZipBuildingTest
run: |
mkdir -p zip_output_dir
sh -x scripts/build_zip.sh zip_output_dir
sh -x scripts/build_zip.sh zip_output_dir "${{ github.event.inputs.custom_spec_repos || 'https://github.com/firebase/SpecsStaging.git' }}"
- uses: actions/upload-artifact@v1
with:
name: Firebase-actions-dir
Expand All @@ -47,7 +54,7 @@ jobs:

quickstart_framework_abtesting:
# Don't run on private repo.
if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
if: (github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk') || github.event_name == 'workflow_dispatch'
needs: package
env:
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
Expand Down Expand Up @@ -92,7 +99,7 @@ jobs:

quickstart_framework_auth:
# Don't run on private repo.
if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
if: (github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk') || github.event_name == 'workflow_dispatch'
needs: package
env:
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
Expand Down Expand Up @@ -136,7 +143,7 @@ jobs:

quickstart_framework_config:
# Don't run on private repo.
if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
if: (github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk') || github.event_name == 'workflow_dispatch'
needs: package
env:
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
Expand Down Expand Up @@ -177,7 +184,7 @@ jobs:

quickstart_framework_crashlytics:
# Don't run on private repo.
if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
if: (github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk') || github.event_name == 'workflow_dispatch'
needs: package
env:
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
Expand Down Expand Up @@ -227,7 +234,7 @@ jobs:

quickstart_framework_database:
# Don't run on private repo.
if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
if: (github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk') || github.event_name == 'workflow_dispatch'
needs: package
env:
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
Expand Down Expand Up @@ -272,7 +279,7 @@ jobs:

quickstart_framework_dynamiclinks:
# Don't run on private repo.
if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
if: (github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk') || github.event_name == 'workflow_dispatch'
needs: package
env:
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
Expand Down Expand Up @@ -322,7 +329,7 @@ jobs:

quickstart_framework_firestore:
# Don't run on private repo.
if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
if: (github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk') || github.event_name == 'workflow_dispatch'
needs: package
env:
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
Expand Down Expand Up @@ -365,7 +372,7 @@ jobs:

quickstart_framework_inappmessaging:
# Don't run on private repo.
if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
if: (github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk') || github.event_name == 'workflow_dispatch'
needs: package
env:
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
Expand Down Expand Up @@ -411,7 +418,7 @@ jobs:

quickstart_framework_messaging:
# Don't run on private repo.
if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
if: (github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk') || github.event_name == 'workflow_dispatch'
needs: package
env:
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
Expand Down Expand Up @@ -456,7 +463,7 @@ jobs:

quickstart_framework_storage:
# Don't run on private repo.
if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
if: (github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk') || github.event_name == 'workflow_dispatch'
needs: package
env:
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
Expand Down
9 changes: 6 additions & 3 deletions scripts/build_zip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
set -x
REPO=`pwd`

if [[ $# -lt 1 ]]; then
cat 1>&2 <<EOF
if [[ $# -lt 2 ]]; then
cat 2>&2 <<EOF
USAGE: $0 [output_directory]
USAGE: $1 [custom-spec-repos]
EOF
exit 1
fi
Expand All @@ -25,8 +26,10 @@ fi
# output directory.
OUTPUT_DIR="$REPO/$1"

CUSTOM_SPEC_REPOS="$2"

cd ReleaseTooling
swift run zip-builder --keep-build-artifacts --update-pod-repo \
--local-podspec-path "${REPO}" \
--enable-carthage-build --output-dir "${OUTPUT_DIR}" \
--custom-spec-repos https://github.com/firebase/SpecsStaging.git
--custom-spec-repos "${CUSTOM_SPEC_REPOS}"

0 comments on commit 7ecc4a7

Please sign in to comment.