-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathaction.yaml
More file actions
90 lines (88 loc) · 3.14 KB
/
action.yaml
File metadata and controls
90 lines (88 loc) · 3.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# Copyright 2024 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.
# GitHub action job to test core java library features on
# downstream client libraries before they are released.
# This composite action should be used in google-cloud-java and handwritten
# libraries to generate changed libraries.
# This composite action serves as a source of truth of scripts that run
# library generation and create pull requests.
name: Hermetic library generation
description: Runs hermetic library generation to produce changed libraries
inputs:
base_ref:
description: base branch
required: true
head_ref:
description: head branch
required: true
image_tag:
description: the tag of hermetic build image
required: false
showcase_mode:
description: true if we need to download the showcase api definitions
required: false
token:
description: Personal Access Token
required: true
force_regenerate_all:
description: true if we want to regenerate all libraries
required: false
runs:
using: "composite"
steps:
- uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Copy python script
shell: bash
run: |
set -x
# repository root
cd ${{ github.action_path }}/../../
rsync -rv \
--exclude=tests \
hermetic_build "${GITHUB_WORKSPACE}"
- name: Copy shell script
shell: bash
run: |
cd ${{ github.action_path }}
cp hermetic_library_generation.sh "${GITHUB_WORKSPACE}"
- name: Install python packages
shell: bash
run: |
cd "${GITHUB_WORKSPACE}"
pip install --require-hashes -r hermetic_build/common/requirements.txt
pip install hermetic_build/common
pip install --require-hashes -r hermetic_build/release_note_generation/requirements.txt
pip install hermetic_build/release_note_generation
- name: Generate changed libraries
shell: bash
run: |
set -x
[ -z "$(git config user.email)" ] && git config --global user.email "cloud-java-bot@google.com"
[ -z "$(git config user.name)" ] && git config --global user.name "cloud-java-bot"
cd "${GITHUB_WORKSPACE}"
bash hermetic_library_generation.sh \
--target_branch "${BASE_REF}" \
--current_branch "${HEAD_REF}" \
--showcase_mode "${SHOWCASE_MODE}" \
--image_tag "${IMAGE_TAG}" \
--force_regenerate_all "${FORCE_REGENERATE_ALL}"
env:
BASE_REF: ${{ inputs.base_ref }}
HEAD_REF: ${{ inputs.head_ref }}
IMAGE_TAG: ${{ inputs.image_tag }}
SHOWCASE_MODE: ${{ inputs.showcase_mode }}
GH_TOKEN: ${{ inputs.token }}
FORCE_REGENERATE_ALL: ${{ inputs.force_regenerate_all }}