-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: add experimental release action (#221)
Signed-off-by: Yulong Ruan <[email protected]>
- Loading branch information
Showing
1 changed file
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 }} |