This repository has been archived by the owner on Mar 31, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added github action workflow for CI/CD (#31)
- Loading branch information
1 parent
6b58f80
commit 9cb150a
Showing
3 changed files
with
98 additions
and
1 deletion.
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,53 @@ | ||
name: Release SQL CLI Artifacts | ||
# This workflows is triggered on creating tags to master or an opendistro release branch | ||
on: | ||
push: | ||
# TODO: use tags in next release | ||
branches: | ||
- 'opendistro-*' | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: [ubuntu-16.04] | ||
strategy: | ||
matrix: | ||
python-version: [3.8] | ||
|
||
steps: | ||
- name: Checkout SQL CLI | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- 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: Install Dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel twine | ||
# publish to S3 and PyPI | ||
- name: Build and Publish | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
artifact=`ls ./dist/*.tar.gz` | ||
wheel_artifact= `ls ./dist/*.whl` | ||
aws s3 cp $artifact s3://artifacts.opendistroforelasticsearch.amazon.com/downloads/elasticsearch-clients/opendistro-sql-cli/ | ||
aws s3 cp $wheel_artifact s3://artifacts.opendistroforelasticsearch.amazon.com/downloads/elasticsearch-clients/opendistro-sql-cli/ | ||
# aws cloudfront create-invalidation --distribution-id ${{ secrets.DISTRIBUTION_ID }} --paths "/downloads/*" | ||
|
||
# TODO: Publish to PyPI | ||
# env: | ||
# TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | ||
# TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
# run: twine upload dist/* |
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,44 @@ | ||
name: Test and Build | ||
|
||
on: [pull_request, push] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: [ubuntu-16.04] | ||
strategy: | ||
matrix: | ||
python-version: [3.8] | ||
|
||
steps: | ||
- name: Checkout SQL CLI | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install Dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements-dev.txt | ||
pip install setuptools wheel | ||
# TODO: this test will pass, because we haven't spin up an ES instance | ||
- name: Run Tox Testing | ||
run: tox | ||
|
||
- name: Build Artifact | ||
run: python setup.py sdist bdist_wheel | ||
|
||
- name: Create Artifact Path | ||
run: | | ||
mkdir -p opendistro-sql-cli-builds | ||
cp -r ./dist/*.tar.gz ./dist/*.whl opendistro-sql-cli-builds/ | ||
- name: Upload Artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: opendistro-sql-cli | ||
path: opendistro-sql-cli-builds |
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