Skip to content

revert

revert #6

# Copyright 2026 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
#
# https://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: Spanner Targeted Release
on:
push:
branches:
- targeted-release
workflow_dispatch:
inputs:
projectId:
description: 'Target GCP Project ID'
type: string
required: true
default: 'span-cloud-migrations-staging'
bucketName:
description: 'Target GCS Bucket Name'
type: string
required: true
default: 'spanner-migrations-staging'
stagePrefix:
description: 'Prefix for staging the template (e.g., templates-2025-10-31). If blank, defaults to templates-YYYY-MM-DD using current date.'
type: string
required: false
default: ''
templateName:
description: 'Template Name to build and stage'
type: string
required: true
default: 'Spanner_to_SourceDb'
modulePath:
description: 'Maven module directory of the template to build'
type: string
required: true
default: 'v2/spanner-to-sourcedb'
runnerLabels:
description: 'Runner labels formatted as a JSON array'
type: string
required: true
default: '["self-hosted", "spanner-it"]'
env:
MAVEN_OPTS: >-
-Dorg.slf4j.simpleLogger.log.org.apache.maven.plugins.shade=error
--add-opens java.base/java.nio=ALL-UNNAMED
--add-opens java.base/sun.nio.ch=ALL-UNNAMED
--add-opens java.base/java.lang=ALL-UNNAMED
--add-opens java.base/java.util=ALL-UNNAMED
permissions:
contents: read
jobs:
targeted_release:
name: Targeted Template Release
runs-on: ${{ fromJSON(github.event.inputs.runnerLabels || '["self-hosted", "release"]') }}
steps:
- name: Checkout Code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Environment
id: setup-env
uses: ./.github/actions/setup-env
- name: Resolve Variables
id: resolve-vars
run: |
PROJECT_ID="${{ github.event.inputs.projectId }}"
PROJECT_ID="${PROJECT_ID:-span-cloud-migrations-staging}"
BUCKET_NAME="${{ github.event.inputs.bucketName }}"
BUCKET_NAME="${BUCKET_NAME:-spanner-migrations-staging}"
TEMPLATE_NAME="${{ github.event.inputs.templateName }}"
TEMPLATE_NAME="${TEMPLATE_NAME:-Spanner_to_SourceDb}"
MODULE_PATH="${{ github.event.inputs.modulePath }}"
MODULE_PATH="${MODULE_PATH:-v2/spanner-to-sourcedb}"
STAGE_PREFIX="${{ github.event.inputs.stagePrefix }}"
if [ -z "$STAGE_PREFIX" ]; then
STAGE_PREFIX="templates-$(date +'%Y-%m-%d')"
fi
echo "Resolved Variables:"
echo "-------------------"
echo "Project ID: $PROJECT_ID"
echo "Bucket Name: $BUCKET_NAME"
echo "Template Name: $TEMPLATE_NAME"
echo "Module Path: $MODULE_PATH"
echo "Stage Prefix: $STAGE_PREFIX"
echo "-------------------"
echo "projectId=$PROJECT_ID" >> $GITHUB_OUTPUT
echo "bucketName=$BUCKET_NAME" >> $GITHUB_OUTPUT
echo "templateName=$TEMPLATE_NAME" >> $GITHUB_OUTPUT
echo "modulePath=$MODULE_PATH" >> $GITHUB_OUTPUT
echo "stagePrefix=$STAGE_PREFIX" >> $GITHUB_OUTPUT
shell: bash
- name: Build & Stage Template
run: |
echo "Starting Spanner Targeted Release staging..."
mvn clean package -PtemplatesStage \
-DprojectId="${{ steps.resolve-vars.outputs.projectId }}" \
-DbucketName="${{ steps.resolve-vars.outputs.bucketName }}" \
-DstagePrefix="${{ steps.resolve-vars.outputs.stagePrefix }}" \
-DtemplateName="${{ steps.resolve-vars.outputs.templateName }}" \
-Dmaven.test.skip \
-DskipIntegrationTests \
-pl ${{ steps.resolve-vars.outputs.modulePath }} -am
shell: bash
- name: Cleanup Java Environment
uses: ./.github/actions/cleanup-java-env
if: always()