feat(pnv): Add Firebase Phone Number Verification support #934
Workflow file for this run
This file contains hidden or 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
| # Copyright 2020 Google LLC | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, | |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| # See the License for the specific language governing permissions and | |
| # limitations under the License. | |
| name: Release Candidate | |
| on: | |
| # Run the workflow when: | |
| # 1. A PR is created or updated (staging checks). | |
| # 2. A commit is pushed to dev (release publication). | |
| # 3. A developer explicitly requests a build via 'firebase_build' event. | |
| pull_request: | |
| types: [opened, synchronize] | |
| push: | |
| branches: | |
| - dev | |
| paths: | |
| - 'firebase.go' | |
| repository_dispatch: | |
| types: | |
| - firebase_build | |
| jobs: | |
| stage_release: | |
| # To publish a release, merge a PR with the title prefix '[chore] Release ' to dev | |
| # and ensure the squashed commit message also has the prefix. | |
| # To stage a release without publishing it, send a 'firebase_build' event or apply | |
| # the 'release:stage' label to a PR. | |
| if: github.event.action == 'firebase_build' || | |
| contains(github.event.pull_request.labels.*.name, 'release:stage') || | |
| (github.event_name == 'push' && startsWith(github.event.head_commit.message, '[chore] Release ')) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | |
| - name: Set up Go | |
| uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 | |
| with: | |
| go-version: '1.25' | |
| - name: Install golint | |
| run: go install golang.org/x/lint/golint@latest | |
| - name: Run Linter | |
| run: | | |
| golint -set_exit_status ./... | |
| - name: Run Tests | |
| run: ./.github/scripts/run_all_tests.sh | |
| env: | |
| FIREBASE_SERVICE_ACCT_KEY: ${{ secrets.FIREBASE_SERVICE_ACCT_KEY }} | |
| FIREBASE_API_KEY: ${{ secrets.FIREBASE_API_KEY }} | |
| publish_release: | |
| needs: stage_release | |
| # Check whether the release should be published. We publish only when the trigger is | |
| # 1. a push (merge) | |
| # 2. to the dev branch | |
| # 3. and the commit message has the title prefix '[chore] Release '. | |
| if: github.event_name == 'push' && | |
| github.ref == 'refs/heads/dev' && | |
| startsWith(github.event.head_commit.message, '[chore] Release ') | |
| runs-on: ubuntu-latest | |
| environment: Release | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout source for publish | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | |
| with: | |
| persist-credentials: false | |
| - name: Publish preflight check | |
| id: preflight | |
| run: ./.github/scripts/publish_preflight_check.sh | |
| # We authorize this step with an access token that has write access to the master branch. | |
| - name: Merge to master | |
| uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0 | |
| with: | |
| github-token: ${{ secrets.FIREBASE_GITHUB_TOKEN }} | |
| script: | | |
| await github.rest.repos.merge({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| base: 'master', | |
| head: 'dev' | |
| }) | |
| # See: https://cli.github.com/manual/gh_release_create | |
| - name: Create release tag | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| RELEASE_VER: ${{ steps.preflight.outputs.version }} | |
| RELEASE_BODY: ${{ steps.preflight.outputs.changelog }} | |
| run: | | |
| gh release create "$RELEASE_VER" \ | |
| --title "Firebase Admin Go SDK $RELEASE_VER" \ | |
| --notes "$RELEASE_BODY" \ | |
| --target "master" |