Skip to content

Release Workflow

Release Workflow #4

name: Release Workflow
# Triggered manually to create release artifacts:
# - opensearch-protobufs-java.tar.gz (Java/Maven artifacts)
# - opensearch-protobufs-{version}.zip (Raw proto files)
# - opensearch_protobufs-{version}-py3-none-any.whl (Python/PyPI artifacts)
on:
workflow_dispatch:
inputs:
release_tag:
description: 'Release tag to create (for example, 1.6.0)'
required: true
type: string
ref:
description: 'Git ref to release from'
required: false
default: 'main'
type: string
jobs:
release:
environment: release-approval
runs-on: ubuntu-latest
permissions: write-all
env:
RELEASE_TAG: ${{ inputs.release_tag }}
RELEASE_REF: ${{ inputs.ref }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
ref: ${{ env.RELEASE_REF }}
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'
cache: gradle
- name: Set up Python 3
uses: actions/setup-python@v6
with:
python-version: '3.10'
- name: Build with Gradle
run: |
./tools/java/package_proto_jar.sh -c true -s false
./gradlew --no-daemon -Dbuild.snapshot=false publishCreatePublicationToLocalRepoRepository
tar -C build -cvf "opensearch-protobufs-java.tar.gz" repository
- name: Create protobuf zip
run: ./tools/package_proto_zip.sh
- name: Build python with bazel
run: |
mkdir -p dist
bazel build //:opensearch_protos_wheel
mv bazel-bin/opensearch_protobufs-*-py3-none-any.whl dist/
- name: Publish python artifacts to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
- name: Release on Github
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.RELEASE_TAG }}
target_commitish: ${{ env.RELEASE_REF }}
draft: true
generate_release_notes: true
files: |
opensearch-protobufs-java.tar.gz
dist/opensearch_protobufs-*-py3-none-any.whl
opensearch-protobufs-*.zip