diff --git a/.github/workflows/release-workflow.yml b/.github/workflows/release-workflow.yml new file mode 100644 index 0000000..84c7ba0 --- /dev/null +++ b/.github/workflows/release-workflow.yml @@ -0,0 +1,55 @@ + +name: Release SQL-Kibana Artifacts + +on: + push: + tags: + - 'v*' + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: us-east-1 + + - name: Checkout Kibana + uses: actions/checkout@v1 + with: + repository: opendistro-for-elasticsearch/kibana-oss + ref: 7.6.1 + token: ${{secrets.OD_ACCESS}} + path: kibana + + - name: Checkout Plugin + uses: actions/checkout@v1 + with: + path: kibana/plugins/sql-kibana-plugin + + - name: Setup Node + uses: actions/setup-node@v1 + with: + node-version: '10.19.0' + + - name: Kibana Pluign Bootstrap + uses: nick-invision/retry@v1 + with: + timeout_minutes: 60 + max_attempts: 3 + command: yarn kbn bootstrap + + - name: Build Artifact + run: | + yarn build + artifact=`ls ./build/*.zip` + + aws s3 cp $artifact s3://artifacts.opendistroforelasticsearch.amazon.com/downloads/kibana-plugins/opendistro-sql-kibana/ + aws cloudfront create-invalidation --distribution-id ${{ secrets.DISTRIBUTION_ID }} --paths "/downloads/*" diff --git a/.github/workflows/test-and-build-workflow.yml b/.github/workflows/test-and-build-workflow.yml new file mode 100644 index 0000000..1d4aa7f --- /dev/null +++ b/.github/workflows/test-and-build-workflow.yml @@ -0,0 +1,44 @@ + +name: Test and Build + +on: [pull_request, push] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - name: Checkout Kibana + uses: actions/checkout@v1 + with: + repository: opendistro-for-elasticsearch/kibana-oss + ref: 7.6.1 + token: ${{secrets.OD_ACCESS}} + path: kibana + - name: Checkout Plugin + uses: actions/checkout@v1 + with: + path: kibana/plugins/sql-kibana-plugin + - name: Setup Node + uses: actions/setup-node@v1 + with: + node-version: '10.19.0' + - name: Kibana Pluign Bootstrap + uses: nick-invision/retry@v1 + with: + timeout_minutes: 60 + max_attempts: 3 + command: yarn kbn bootstrap + - name: Test + run: | + yarn test:jest + - name: Build Artifact + run: | + yarn build + - name: Upload Artifact + uses: actions/upload-artifact@v1 + with: + name: sql-kibana + path: ./build