Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workflow for version increment automation. #2291

Merged
merged 3 commits into from
Jul 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 97 additions & 0 deletions .github/workflows/increment-plugin-versions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
---
name: Increment Plugin Versions

on:
workflow_dispatch:
inputs:
logLevel:
dblock marked this conversation as resolved.
Show resolved Hide resolved
description: Log level
required: true
default: warning
type: choice
options:
- info
- warning
- debug

jobs:
plugin-version-increment-sync:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
entry:
- {repo: alerting}
dblock marked this conversation as resolved.
Show resolved Hide resolved
- {repo: anomaly-detection}
- {repo: asynchronous-search}
- {repo: common-utils}
- {repo: cross-cluster-replication}
- {repo: dashboards-reports, path: reports-scheduler}
- {repo: geospatial}
- {repo: index-management}
- {repo: job-scheduler}
- {repo: k-NN}
- {repo: ml-commons}
- {repo: notifications, path: notifications}
- {repo: observability, path: opensearch-observability}
- {repo: performance-analyzer}
- {repo: performance-analyzer-rca}
- {repo: security}
- {repo: sql}
branch:
- 'main'
- '2.x'
- '2.1'
- '2.2'
steps:
- name: Check out OpenSearch repo
uses: actions/checkout@v3
with:
repository: opensearch-project/OpenSearch
ref: ${{ matrix.branch }}
- name: Fetch OpenSearch version
run: |
OPENSEARCH_VERSION=$(cat buildSrc/version.properties | grep opensearch | cut -d= -f2 | grep -oE '[0-9.]+')
echo "OPENSEARCH_VERSION_NUMBER=$OPENSEARCH_VERSION" >> $GITHUB_ENV
OPENSEARCH_VERSION=$OPENSEARCH_VERSION-SNAPSHOT
echo "OPENSEARCH_VERSION=$OPENSEARCH_VERSION" >> $GITHUB_ENV
- name: Check out plugin repo
uses: actions/checkout@v3
with:
repository: opensearch-project/${{ matrix.entry.repo }}
ref: ${{ matrix.branch }}
- name: Increment Version in ${{ matrix.entry.repo }}
run: |
echo "OpenSearch Core repo version on branch ${{ matrix.branch }} is ${{ env.OPENSEARCH_VERSION_NUMBER }}"
if [ ${{ matrix.entry.path }} ]; then
echo "The gradle path is ${{ matrix.entry.path }}"
cd ${{ matrix.entry.path }}
fi
./gradlew updateVersion -DnewVersion=${{ env.OPENSEARCH_VERSION }}
- name: GitHub App token
id: github_app_token
uses: tibdex/[email protected]
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
installation_id: 27448020
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v4
with:
token: ${{ steps.github_app_token.outputs.token }}
committer: opensearch-ci-bot <[email protected]>
author: opensearch-ci-bot <[email protected]>
commit-message: |
Increment version to ${{ env.OPENSEARCH_VERSION }}

Signed-off-by: opensearch-ci-bot <[email protected]>
delete-branch: true
branch: create-pull-request/${{ env.OPENSEARCH_VERSION }}
title: '[AUTO] Increment version to ${{ env.OPENSEARCH_VERSION }}'
body: |
- Incremented version to **${{ env.OPENSEARCH_VERSION }}**.
- name: Check outputs
run: |-
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"