forked from litiian/security-kibana-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (61 loc) · 2.2 KB
/
cd.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: CD
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout security kibana
uses: actions/checkout@v1
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11.0.x
- name: Test and Build
run: |
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | bash
export NVM_HOME="$HOME/.nvm"
./build.sh
artifact_path=`ls $(pwd)/target/releases/opendistro_security_kibana_plugin-*.zip`
artifact_name=`basename $artifact_path`
echo ::set-env name=ARTIFACT_PATH::$artifact_path
echo ::set-env name=ARTIFACT_NAME::$artifact_name
echo ::set-env name=TAG_VERSION::${GITHUB_REF/refs\/tags\//}
- 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-west-2
- name: Upload Artifacts to S3
run: |
s3_path=s3://artifacts.opendistroforelasticsearch.amazon.com/downloads
aws s3 cp ${{ env.ARTIFACT_PATH }} $s3_path/kibana-plugins/opendistro-security/
aws cloudfront create-invalidation --distribution-id ${{ secrets.DISTRIBUTION_ID }} --paths '/downloads/*'
- name: Create Github Draft Release
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ env.TAG_VERSION }}
draft: true
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_name: ${{ env.ARTIFACT_NAME }}
asset_path: ${{ env.ARTIFACT_PATH }}
asset_content_type: application/zip
- name: Upload Workflow Artifacts
uses: actions/upload-artifact@v1
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ env.ARTIFACT_PATH }}