Skip to content

Commit c736851

Browse files
jDramaixcopybara-github
authored andcommitted
Introduce release GitHub workflow.
This change introduces a reusable GitHub workflow to handle the release process for all J2CL related projects. The git creation tag logic has been moved out of the release script to a specific workflow step. The release process can now be started from the github UI. PiperOrigin-RevId: 782983233
1 parent c516047 commit c736851

File tree

3 files changed

+53
-18
lines changed

3 files changed

+53
-18
lines changed

.github/workflows/release.yaml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Copyright 2025 Google Inc. All Rights Reserved
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 not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# https://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
name: Release Project
16+
17+
# TODO(dramaix): Consider triggering the workflow on git tag creation instead.
18+
# This workflow is triggered manually from the Actions tab.
19+
on:
20+
workflow_dispatch:
21+
inputs:
22+
version:
23+
description: 'The version to release'
24+
required: true
25+
type: string
26+
sonatype_auto_publish:
27+
description: 'Automatically publish the release to Sonatype'
28+
type: boolean
29+
required: true
30+
default: false
31+
create_tag:
32+
description: 'Create a git tag'
33+
type: boolean
34+
required: true
35+
default: true
36+
37+
jobs:
38+
release:
39+
uses: google/j2cl/.github/workflows/release-common.yaml@main
40+
41+
# The reusable workflow requires 'write' access to contents to push a git tag.
42+
permissions:
43+
contents: write
44+
45+
# Pass the inputs from the manual trigger to the reusable workflow.
46+
with:
47+
version: ${{ github.event.inputs.version }}
48+
sonatype_auto_publish: ${{ github.event.inputs.sonatype_auto_publish }}
49+
create_tag: ${{ github.event.inputs.create_tag }}
50+
51+
# Allow the reusable workflow to access the secrets.
52+
secrets: inherit

maven/deploy.sh

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -265,10 +265,3 @@ common::cleanup_temp_files() {
265265
rm -rf "${maven_wd}"
266266
fi
267267
}
268-
269-
common::create_and_push_git_tag() {
270-
local lib_version="$1"
271-
common::info "Creating git tag: ${lib_version}"
272-
git tag -a "${lib_version}" -m "${lib_version} release"
273-
git push origin "${lib_version}"
274-
}

maven/release_jsinterop_base.sh renamed to maven/publish_to_sonatype.sh

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Copyright 2019 Google Inc. All Rights Reserved
2+
# Copyright 2025 Google Inc. All Rights Reserved
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -35,16 +35,13 @@ usage() {
3535
echo " Maven version of the library to use for deploying to sonatype."
3636
echo " --no-deploy"
3737
echo " Skip the deployment part but build all artifacts."
38-
echo " --no-git-tag"
39-
echo " Skip the creation of git tag."
4038
echo " --sonatype-auto-publish"
4139
echo " Publish the artifact on sonatype automatically after upload."
4240
echo ""
4341
}
4442

4543
parse_arguments() {
4644
deploy_to_sonatype=true
47-
git_tag=true
4845
lib_version=""
4946
sonatype_auto_publish=false
5047

@@ -57,9 +54,6 @@ parse_arguments() {
5754
--no-deploy )
5855
deploy_to_sonatype=false
5956
;;
60-
--no-git-tag )
61-
git_tag=false
62-
;;
6357
--sonatype-auto-publish)
6458
sonatype_auto_publish=true
6559
shift
@@ -85,10 +79,6 @@ main() {
8579

8680
common::build
8781
common::deploy_to_sonatype
88-
89-
if [[ ${git_tag} == true ]]; then
90-
common::create_and_push_git_tag ${lib_version}
91-
fi
9282
}
9383

9484
# Set the trap to cleanup temporary files on EXIT

0 commit comments

Comments
 (0)