From 1348cbb660d38130dbc7251093fa564fda2442b8 Mon Sep 17 00:00:00 2001 From: Prudhvi Godithi Date: Wed, 3 May 2023 13:36:55 -0700 Subject: [PATCH] Workflow for OSD Version Increment (#3466) Signed-off-by: Prudhvi Godithi --- ...s.yml => os-increment-plugin-versions.yml} | 11 +- .../osd-increment-plugin-versions.yml | 101 ++++++++++++++++++ 2 files changed, 103 insertions(+), 9 deletions(-) rename .github/workflows/{increment-plugin-versions.yml => os-increment-plugin-versions.yml} (95%) create mode 100644 .github/workflows/osd-increment-plugin-versions.yml diff --git a/.github/workflows/increment-plugin-versions.yml b/.github/workflows/os-increment-plugin-versions.yml similarity index 95% rename from .github/workflows/increment-plugin-versions.yml rename to .github/workflows/os-increment-plugin-versions.yml index 00623f0d0c..f095dc41c9 100644 --- a/.github/workflows/increment-plugin-versions.yml +++ b/.github/workflows/os-increment-plugin-versions.yml @@ -1,5 +1,5 @@ --- -name: Increment Plugin Versions +name: Increment OpenSearch Plugins Version on: schedule: @@ -45,15 +45,8 @@ jobs: branch: - '1.3' - 2.x - - '2.2' - - '2.3' - - '2.4' - - '2.5' - - 3.x - - '3.0' - - '2.6' - '2.7' - - '2.8' + - main exclude: - {entry: {repo: geospatial}, branch: '1.3'} - {entry: {repo: neural-search}, branch: '1.3'} diff --git a/.github/workflows/osd-increment-plugin-versions.yml b/.github/workflows/osd-increment-plugin-versions.yml new file mode 100644 index 0000000000..07559d5d1b --- /dev/null +++ b/.github/workflows/osd-increment-plugin-versions.yml @@ -0,0 +1,101 @@ +--- +name: Increment OpenSearch Dashboards Plugins Version + +on: + workflow_dispatch: + inputs: + logLevel: + description: Log level + required: true + default: warning + type: choice + options: + - info + - warning + - debug +jobs: + osd-plugin-version-increment: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + entry: + - {repo: dashboards-observability} + - {repo: dashboards-reporting} + - {repo: dashboards-visualizations} + - {repo: dashboards-query-workbench} + - {repo: dashboards-maps} + - {repo: anomaly-detection-dashboards-plugin} + - {repo: ml-commons-dashboards} + - {repo: index-management-dashboards-plugin} + - {repo: dashboards-notifications} + - {repo: alerting-dashboards-plugin} + - {repo: security-analytics-dashboards-plugin} + - {repo: security-dashboards-plugin} + - {repo: dashboards-search-relevance} + branch: + - '1.3' + - 2.x + - '2.7' + - main + steps: + - name: Check out OpenSearch Dashboards repo + uses: actions/checkout@v3 + with: + repository: opensearch-project/OpenSearch-Dashboards + ref: ${{ matrix.branch }} + path: OpenSearch-Dashboards + - name: Check out plugin repo + uses: actions/checkout@v3 + with: + repository: opensearch-project/${{ matrix.entry.repo }} + ref: ${{ matrix.branch }} + path: OpenSearch-Dashboards/plugins/${{ matrix.entry.repo }} + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version-file: './OpenSearch-Dashboards/.nvmrc' + registry-url: 'https://registry.npmjs.org' + - name: Install Yarn + shell: bash + run: | + YARN_VERSION=$(node -p "require('./OpenSearch-Dashboards/package.json').engines.yarn") + echo "Installing yarn@$YARN_VERSION" + npm i -g yarn@$YARN_VERSION + - run: node -v + - run: yarn -v + - name: Bootstrap and Version Increment + run: | + cd OpenSearch-Dashboards/plugins/${{ matrix.entry.repo }} + yarn osd bootstrap + yarn plugin-helpers version --sync legacy + OSD_PLUGIN_VERSION=$(node -p "require('./package.json').version") + echo "OSD_PLUGIN_VERSION=$OSD_PLUGIN_VERSION" >> $GITHUB_ENV + - name: GitHub App token + id: github_app_token + uses: tibdex/github-app-token@v1.6.0 + with: + app_id: ${{ secrets.APP_ID }} + private_key: ${{ secrets.APP_PRIVATE_KEY }} + installation_id: 22958780 + - name: Create Pull Request + id: cpr + uses: peter-evans/create-pull-request@v5 + with: + token: ${{ steps.github_app_token.outputs.token }} + committer: opensearch-ci-bot + author: opensearch-ci-bot + commit-message: | + Increment version to ${{ env.OSD_PLUGIN_VERSION }} + + Signed-off-by: opensearch-ci-bot + delete-branch: true + branch: create-pull-request/${{ env.OSD_PLUGIN_VERSION }} + title: '[AUTO] Increment version to ${{ env.OSD_PLUGIN_VERSION }}' + body: | + - Incremented version to **${{ env.OSD_PLUGIN_VERSION }}**. + path: 'OpenSearch-Dashboards/plugins/${{ matrix.entry.repo }}' + - name: Check outputs + run: |- + echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" + echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"