forked from opendistro-for-elasticsearch/sql
-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (57 loc) · 2.12 KB
/
sql-cli-release-workflow.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
name: Release SQL CLI Artifacts
# This workflows is triggered on creating tags to master
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: [ubuntu-16.04]
defaults:
run:
working-directory: sql-cli
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_STAGING_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_STAGING_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build
run: |
python setup.py sdist bdist_wheel
- name: Publish to S3
shell: bash
run: |
tarball=`ls ./dist/*.tar.gz`
wheel=`ls ./dist/*.whl`
renamed_wheel=`echo $wheel | sed 's/_/-/g'`
mv "$wheel" "$renamed_wheel"
wheel=`ls ./dist/*.whl`
# Inject the build number before the suffix
tarball_outfile=`basename ${tarball%.tar.gz}-build-${GITHUB_RUN_NUMBER}.tar.gz`
wheel_outfile=`basename ${wheel%.whl}-build-${GITHUB_RUN_NUMBER}.whl`
s3_prefix="s3://staging.artifacts.opendistroforelasticsearch.amazon.com/snapshots/elasticsearch-clients/sql-cli/"
echo "Copying ${tarball} to ${s3_prefix}${tarball_outfile}"
aws s3 cp --quiet $tarball ${s3_prefix}${tarball_outfile}
echo "Copying ${wheel} to ${s3_prefix}${wheel_outfile}"
aws s3 cp --quiet $wheel ${s3_prefix}${wheel_outfile}
# TODO: Publish to PyPI
# - name: Publish to PyPI
# env:
# TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
# TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
# run: twine upload dist/*