Skip to content

fix: changes 'GITHUB_TOKEN' to 'GH_TOKEN'. (#37) #3

fix: changes 'GITHUB_TOKEN' to 'GH_TOKEN'. (#37)

fix: changes 'GITHUB_TOKEN' to 'GH_TOKEN'. (#37) #3

# Copyright 2025 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.
## Runs the release-please action for all new pushes to the main branch.
## This will create new release-PRs, create GitHub releases, update
## the CHANGELOG.md, and upload /dist to the Cloud bucket.
on:
push:
branches: [main]
permissions:
contents: write
pull-requests: write
name: Release Please
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- id: release
name: Release Please
uses: google-github-actions/release-please-action@v3
with:
release-type: node
token: ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }}
package-name: "@googlemaps/js-api-samples"
bump-minor-pre-major: true
- if: ${{ steps.release.outputs.release_created }}
name: Checkout
uses: actions/checkout@v3
- if: ${{ steps.release.outputs.release_created }}
name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 20
cache: 'npm' # Cache node_modules
- if: ${{ steps.release.outputs.release_created }}
name: Install Dependencies
run: npm ci
- if: ${{ steps.release.outputs.release_created }}
name: Build
run: npm run build
- if: ${{ steps.release.outputs.release_created }}
name: Update dist
run: |
git config --global user.name 'googlemaps-bot'
git config --global user.email 'googlemaps-bot@google.com'
git add dist
git commit -m "chore: update dist folder [skip ci]" || true
git push origin
# Upload /dist to the Cloud bucket.
- if: ${{ steps.release.outputs.release_created }}
name: Upload to Cloud Bucket
run: |
bash ./upload-to-bucket.sh
env:
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_CLOUD_CREDENTIALS }}
# NPM Publishing (unchanged)
- if: ${{ steps.release.outputs.release_created }}
name: Setup Node for Publishing
uses: actions/setup-node@v3
with:
node-version: 20
registry-url: "https://wombat-dressing-room.appspot.com/"
- if: ${{ steps.release.outputs.release_created }}
name: Publish
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_WOMBAT_TOKEN }}
- if: ${{ steps.release.outputs.release_created }}
name: Upload to Cloud Bucket
run: |
bash ./upload-to-bucket.sh
env:
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_CLOUD_CREDENTIALS }}