This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright 2025 Google LLC | ||
|
Check failure on line 1 in .github/workflows/release.yaml
|
||
| # | ||
| # 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.0rg/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 Project | ||
| permissions: | ||
| contents: read | ||
| # This workflow is triggered manually from the Actions tab. | ||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| version: | ||
| description: 'The version to release' | ||
| required: true | ||
| type: string | ||
| continue_if_tag_exists: | ||
| description: 'Continue the workflow even if the GitHub tag already exists' | ||
| type: boolean | ||
| required: true | ||
| default: false | ||
| env: | ||
| publish_to_bcr: ${{ github.event.repository.name != 'jsinterop-annotations' }} | ||
| publish_to_sonatype: ${{ github.event.repository.name != 'jsinterop-generator' && github.event.repository.name != 'j2cl' }} | ||
| continue_if_tag_exists: ${{ github.event.inputs.continue_if_tag_exists == 'true' }} | ||
| jobs: | ||
| # We need two separate jobs based on whether we are releasing to BCR. Releasing to BCR requires | ||
| # elevated permissions, which cannot be set dynamically within a single job. | ||
| # TODO(dramaix): merge release_common.yaml into this file and remove the need for two jobs. | ||
| release_with_bcr: | ||
| if: ${{ env.publish_to_bcr }} | ||
| uses: ./.github/workflows/release_common.yaml | ||
| permissions: | ||
| # Permissions for creating a github release. | ||
| contents: write | ||
| # Permissions for publishing to bcr. | ||
| id-token: write | ||
| attestations: write | ||
| # Pass the inputs from the manual trigger to the reusable workflow. | ||
| with: | ||
| version: ${{ github.event.inputs.version }} | ||
| publish_to_sonatype: ${{ env.publish_to_sonatype }} | ||
| continue_if_tag_exists: ${{ env.continue_if_tag_exists }} | ||
| publish_to_bcr: true | ||
| # Allow the reusable workflow to access the secrets. | ||
| secrets: inherit | ||
| release_without_bcr: | ||
| if: ${{ !env.publish_to_bcr }} | ||
| uses: ./.github/workflows/release_common.yaml | ||
| permissions: | ||
| # Permissions for creating a github release. | ||
| contents: write | ||
| # Pass the inputs from the manual trigger to the reusable workflow. | ||
| with: | ||
| version: ${{ github.event.inputs.version }} | ||
| publish_to_sonatype: ${{ env.publish_to_sonatype }} | ||
| continue_if_tag_exists: ${{ env.continue_if_tag_exists }} | ||
| publish_to_bcr: false | ||
| # Allow the reusable workflow to access the secrets. | ||
| secrets: inherit | ||