Skip to content

feat(fcm): Add support for bandwidth constrained and restricted satellite APIs #643

feat(fcm): Add support for bandwidth constrained and restricted satellite APIs

feat(fcm): Add support for bandwidth constrained and restricted satellite APIs #643

Workflow file for this run

# Copyright 2020 Google Inc.
#
# 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 main (release publication).
# 3. A developer explicitly requests a build via 'firebase_build' event.
pull_request:
types: [opened, synchronize]
push:
branches:
- main
paths:
- 'FirebaseAdmin/FirebaseAdmin/FirebaseAdmin.csproj'
repository_dispatch:
types:
- firebase_build
jobs:
stage_release:
# To publish a release, merge a PR with the title prefix '[chore] Release ' to main
# 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 '))
# Build and package artifacts on Windows.
runs-on: ubuntu-latest
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_NOLOGO: 1
steps:
- name: Checkout source for staging
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
- name: Setup .NET
uses: actions/setup-dotnet@2016bd2012dba4e32de620c46fe006a3ac9f0602 # v5.0.1
with:
dotnet-version: 6.0.x
- name: Install Mono
run: |
sudo apt update
sudo apt install -y mono-complete
- name: Install dependencies
run: dotnet restore FirebaseAdmin/FirebaseAdmin.sln
- name: Build with dotnet
run: dotnet build FirebaseAdmin/FirebaseAdmin.sln --configuration Release --no-restore
- name: Run unit tests
run: dotnet test FirebaseAdmin/FirebaseAdmin.Tests --configuration Release --no-restore --no-build
- name: Run integration tests
run: ./.github/scripts/run_integration_tests.sh
env:
FIREBASE_SERVICE_ACCT_KEY: ${{ secrets.FIREBASE_SERVICE_ACCT_KEY }}
FIREBASE_API_KEY: ${{ secrets.FIREBASE_API_KEY }}
- name: Package release artifacts
run: dotnet pack FirebaseAdmin/FirebaseAdmin.sln --configuration Release --no-restore --no-build
# Attach the packaged artifacts to the workflow output. These can be manually
# downloaded for later inspection if necessary.
- name: Archive artifacts
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: Release
path: FirebaseAdmin/FirebaseAdmin/bin/Release
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 main branch
# 3. and the commit message has the title prefix '[chore] Release '.
if: github.event_name == 'push' &&
github.ref == 'refs/heads/main' &&
startsWith(github.event.head_commit.message, '[chore] Release ')
# Use Linux for this phase, so we can reuse the same helper scripts as other Admin SDK
# repositories.
runs-on: ubuntu-latest
environment: Release
permissions:
# Used to create a short-lived OIDC token which is given to NuGet to identify this workflow job
# See: https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect#adding-permissions-settings
# and https://learn.microsoft.com/en-us/nuget/nuget-org/trusted-publishing
id-token: write
contents: write
steps:
- name: Checkout source for publish
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
# Download the artifacts created by the stage_release job.
- name: Download release candidates
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
with:
name: Release
path: Release
- name: Setup .NET
uses: actions/setup-dotnet@2016bd2012dba4e32de620c46fe006a3ac9f0602 # v5.0.1
with:
dotnet-version: 6.0.x
- name: Publish preflight check
id: preflight
run: ./.github/scripts/publish_preflight_check.sh
# 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 .NET SDK $RELEASE_VER" \
--notes "$RELEASE_BODY"
# Login to NuGet using OIDC and generate a short-lived NuGet API key
- name: Nuget login
uses: NuGet/login@d22cc5f58ff5b88bf9bd452535b4335137e24544 # v1
id: nuget_login
with:
user: ${{ secrets.NUGET_USER }}
- name: Publish to Nuget
run: ./.github/scripts/publish_package.sh
env:
NUGET_KEY: ${{ steps.nuget_login.outputs.NUGET_API_KEY }}
VERSION: ${{ steps.preflight.outputs.version }}