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

feat: enable windows and macos builds #1108

Merged
merged 16 commits into from
Oct 20, 2022
Merged
Show file tree
Hide file tree
Changes from 7 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
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env:

jobs:

build:
linux-build:

runs-on: ubuntu-latest

Expand Down Expand Up @@ -73,6 +73,115 @@ jobs:
- name: Upload Artifact
uses: actions/upload-artifact@v1
with:
name: dashboards-observability
name: dashboards-observability-ubuntu
path: ./OpenSearch-Dashboards/plugins/dashboards-observability/build

windows-build:

runs-on: windows-latest

steps:
- name: Checkout Plugin
uses: actions/checkout@v1

- name: Checkout OpenSearch Dashboards
uses: actions/checkout@v2
with:
repository: opensearch-project/OpenSearch-Dashboards
ref: ${{ env.OPENSEARCH_VERSION }}
path: OpenSearch-Dashboards

- name: Get node and yarn versions
id: versions_step
run: |
echo "::set-output name=node_version::$(node -p "(require('./OpenSearch-Dashboards/package.json').engines.node).match(/[.0-9]+/)[0]")"
echo "::set-output name=yarn_version::$(node -p "(require('./OpenSearch-Dashboards/package.json').engines.yarn).match(/[.0-9]+/)[0]")"

- name: Setup node
uses: actions/setup-node@v1
with:
node-version: ${{ steps.versions_step.outputs.node_version }}
registry-url: 'https://registry.npmjs.org'

- name: Install correct yarn version for OpenSearch Dashboards
run: |
npm uninstall -g yarn
echo "Installing yarn ${{ steps.versions_step.outputs.yarn_version }}"
npm i -g yarn@${{ steps.versions_step.outputs.yarn_version }}

- name: Move Observability to Plugins Dir
run: mv dashboards-observability OpenSearch-Dashboards/plugins/dashboards-observability

- name: Plugin Bootstrap
run: |
cd OpenSearch-Dashboards/plugins/dashboards-observability
yarn osd bootstrap

derek-ho marked this conversation as resolved.
Show resolved Hide resolved
# TODO remove hard coded version when observability is ready
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove the comment if not used.

- name: Build Artifact
run: |
cd OpenSearch-Dashboards/plugins/dashboards-observability
yarn build
mv ./build/*.zip ./build/${{ env.PLUGIN_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}.zip

- name: Upload Artifact
uses: actions/upload-artifact@v1
with:
name: dashboards-observability-windows
path: ./OpenSearch-Dashboards/plugins/dashboards-observability/build

macos-build:

runs-on: macos-latest

steps:
- name: Checkout Plugin
uses: actions/checkout@v1

- name: Checkout OpenSearch Dashboards
uses: actions/checkout@v2
with:
repository: opensearch-project/OpenSearch-Dashboards
ref: ${{ env.OPENSEARCH_VERSION }}
path: OpenSearch-Dashboards

- name: Get node and yarn versions
id: versions_step
run: |
echo "::set-output name=node_version::$(node -p "(require('./OpenSearch-Dashboards/package.json').engines.node).match(/[.0-9]+/)[0]")"
echo "::set-output name=yarn_version::$(node -p "(require('./OpenSearch-Dashboards/package.json').engines.yarn).match(/[.0-9]+/)[0]")"

- name: Setup node
uses: actions/setup-node@v1
with:
node-version: ${{ steps.versions_step.outputs.node_version }}
registry-url: 'https://registry.npmjs.org'

- name: Install correct yarn version for OpenSearch Dashboards
run: |
npm uninstall -g yarn
echo "Installing yarn ${{ steps.versions_step.outputs.yarn_version }}"
npm i -g yarn@${{ steps.versions_step.outputs.yarn_version }}

- name: Move Observability to Plugins Dir
run: mv dashboards-observability OpenSearch-Dashboards/plugins/dashboards-observability

- name: Plugin Bootstrap
run: |
cd OpenSearch-Dashboards/plugins/dashboards-observability
yarn osd bootstrap

# TODO remove hard coded version when observability is ready
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here.

- name: Build Artifact
run: |
cd OpenSearch-Dashboards/plugins/dashboards-observability
yarn build
mv ./build/*.zip ./build/${{ env.PLUGIN_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}.zip

- name: Upload Artifact
uses: actions/upload-artifact@v1
with:
name: dashboards-observability-macos
path: ./OpenSearch-Dashboards/plugins/dashboards-observability/build


Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Test and Build OpenSearch Observability Backend Plugin
on: [pull_request, push]

jobs:
build:
linux-build:
strategy:
matrix:
java:
Expand Down Expand Up @@ -46,5 +46,72 @@ jobs:
- name: Upload Artifacts
uses: actions/upload-artifact@v1
with:
name: opensearch-observability
name: opensearch-observability-ubuntu
path: opensearch-observability-builds

windows-build:
strategy:
matrix:
java:
- 11
- 17

runs-on: windows-latest

steps:
- uses: actions/checkout@v1

- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}

derek-ho marked this conversation as resolved.
Show resolved Hide resolved
- name: Build with Gradle
run: |
cd opensearch-observability
./gradlew.bat build -x integTest -x jacocoTestReport

- name: Create Artifact Path
run: |
mkdir -p opensearch-observability-builds
cp -r ./opensearch-observability/build/distributions/*.zip opensearch-observability-builds/

- name: Upload Artifacts
uses: actions/upload-artifact@v1
with:
name: opensearch-observability-windows
path: opensearch-observability-builds

macos-build:
strategy:
matrix:
java:
- 11
- 17

runs-on: macos-latest

steps:
- uses: actions/checkout@v1

- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}

- name: Build with Gradle
run: |
cd opensearch-observability
./gradlew build -x integTest -x jacocoTestReport

- name: Create Artifact Path
run: |
mkdir -p opensearch-observability-builds
cp -r ./opensearch-observability/build/distributions/*.zip opensearch-observability-builds/

- name: Upload Artifacts
uses: actions/upload-artifact@v1
with:
name: opensearch-observability-macos
path: opensearch-observability-builds