Merge branch 'add_jar' #3
Workflow file for this run
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
| name: Release drafter | |
| # Push events to every tag not containing "/" | |
| # | |
| # Create artifacts for Github release and publish to public repositories | |
| # - 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: | |
| push: | |
| tags: | |
| - "*" | |
| jobs: | |
| draft-a-release: | |
| name: Draft a release | |
| runs-on: ubuntu-latest | |
| permissions: write-all | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - id: get_data | |
| run: | | |
| echo "approvers=$(cat .github/CODEOWNERS | grep @ | tr -d '*\n ' | sed 's/@/,/g' | sed 's/,//1')" >> $GITHUB_OUTPUT | |
| echo "version=$(cat version.properties)" >> $GITHUB_OUTPUT | |
| - uses: trstringer/manual-approval@v1 | |
| with: | |
| secret: ${{ github.TOKEN }} | |
| approvers: ${{ steps.get_data.outputs.approvers }} | |
| minimum-approvals: 2 | |
| issue-title: 'Release OpenSearch Protobufs ${{ steps.get_data.outputs.version }}' | |
| issue-body: "Please approve or deny the release of OpenSearch Protobufs **TAG**: ${{ github.ref_name }} **COMMIT**: ${{ github.sha }} **VERSION** : ${{ steps.get_data.outputs.version }} " | |
| exclude-workflow-initiator-as-approver: true | |
| - 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@v3 | |
| 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: Draft a release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| draft: true | |
| generate_release_notes: true | |
| files: | | |
| opensearch-protobufs-java.tar.gz | |
| dist/opensearch_protobufs-*-py3-none-any.whl | |
| opensearch-protobufs-*.zip |