|
| 1 | + # Copyright 2025 Google LLC |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +## Runs the release-please action for all new pushes to the main branch. |
| 16 | +## This updates the CHANGELOG.md, and uploads the contents of /dist to |
| 17 | +## the Cloud bucket. It does NOT release to Node, but it provides |
| 18 | +## handy version incrementing which is useful for us. |
| 19 | + |
| 20 | +name: Release |
| 21 | + |
| 22 | +on: |
| 23 | + release: |
| 24 | + types: [published] |
| 25 | +jobs: |
| 26 | + release: |
| 27 | + runs-on: ubuntu-latest |
| 28 | + permissions: |
| 29 | + contents: read |
| 30 | + id-token: write |
| 31 | + env: |
| 32 | + GOOGLE_MAPS_JS_SAMPLES_KEY: "${{ secrets.GOOGLE_MAPS_JS_SAMPLES_KEY }}" |
| 33 | + steps: |
| 34 | + - uses: actions/checkout@v3 |
| 35 | + with: |
| 36 | + token: ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }} |
| 37 | + - uses: actions/cache@v3 |
| 38 | + with: |
| 39 | + path: ~/.npm |
| 40 | + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} |
| 41 | + restore-keys: | |
| 42 | + ${{ runner.os }}-node |
| 43 | + - uses: actions/setup-node@v3 |
| 44 | + with: |
| 45 | + node-version: '20' |
| 46 | + - run: npm i |
| 47 | + - run: npm run build-all |
| 48 | + |
| 49 | + - uses: google-github-actions/auth@v1 |
| 50 | + with: |
| 51 | + credentials_json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_KEY }} |
| 52 | + |
| 53 | + - name: Install Firebase CLI |
| 54 | + run: npm install -g firebase-tools |
| 55 | + |
| 56 | + - name: Deploy to Firebase Hosting |
| 57 | + run: firebase deploy --only hosting |
| 58 | + |
| 59 | + - name: Semantic Release |
| 60 | + |
| 61 | + with: |
| 62 | + extra_plugins: | |
| 63 | + "@semantic-release/[email protected]" |
| 64 | + "@semantic-release/[email protected]" |
| 65 | + "@semantic-release/[email protected]" |
| 66 | + "@semantic-release/[email protected]" |
| 67 | + env: |
| 68 | + GH_TOKEN: ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }} |
0 commit comments