From d9f031ad9834c33596f5dbcb311af3308a170a91 Mon Sep 17 00:00:00 2001 From: Yulong Ruan Date: Tue, 20 Jun 2023 10:26:56 +0800 Subject: [PATCH] build: add experimental release action (#221) Signed-off-by: Yulong Ruan --- .github/workflows/experimental-release.yml | 65 ++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 .github/workflows/experimental-release.yml diff --git a/.github/workflows/experimental-release.yml b/.github/workflows/experimental-release.yml new file mode 100644 index 00000000..de6f891c --- /dev/null +++ b/.github/workflows/experimental-release.yml @@ -0,0 +1,65 @@ +name: experimental-release + +on: + workflow_dispatch: + inputs: + opensearch_dashboards_version: + description: 'Which version of OpenSearch-Dashboards that this build is targeting' + required: false + default: '2.x' + +jobs: + build: + name: Build + runs-on: ubuntu-latest + env: + RELEASE_TAG: ${{ github.event.inputs.opensearch_dashboards_version }}-experimental.${{ github.run_id }} + + steps: + - run: echo Target OpenSearch-Dashboards version ${{ github.event.inputs.opensearch_dashboards_version }} + - name: Checkout OpenSearch Dashboards + uses: actions/checkout@v2 + with: + repository: opensearch-project/OpenSearch-Dashboards + ref: ${{ github.event.inputs.opensearch_dashboards_version }} + path: OpenSearch-Dashboards + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version-file: './OpenSearch-Dashboards/.nvmrc' + registry-url: 'https://registry.npmjs.org' + - name: Install Yarn + # Need to use bash to avoid having a windows/linux specific step + 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: Checkout ML Commons OpenSearch Dashboards plugin + uses: actions/checkout@v2 + with: + path: OpenSearch-Dashboards/plugins/ml-commons-dashboards + - name: Bootstrap plugin/opensearch-dashboards + run: | + cd OpenSearch-Dashboards/plugins/ml-commons-dashboards + yarn osd bootstrap + - name: Run build + run: | + cd OpenSearch-Dashboards/plugins/ml-commons-dashboards + yarn run build + - name: Create Release Tag + run: | + cd OpenSearch-Dashboards/plugins/ml-commons-dashboards + git tag ${{ env.RELEASE_TAG }} + git push origin ${{ env.RELEASE_TAG }} + - name: Release + id: release_step + uses: softprops/action-gh-release@v1 + with: + files: OpenSearch-Dashboards/plugins/ml-commons-dashboards/build/*.zip + tag_name: ${{ env.RELEASE_TAG }} + - name: Update Artifact URL + run: | + echo ${{ steps.release_step.outputs.assets }}