-
Notifications
You must be signed in to change notification settings - Fork 22
40 lines (37 loc) · 1.39 KB
/
licenses.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
name: Upload licenses to S3
on: ["push"]
jobs:
upload:
runs-on: ubuntu-latest
env:
FILE: ./licence_compliance.csv
AWS_REGION: 'us-east-1'
S3_BUCKET: 'project-license-dependency'
S3_KEY: ${{ github.event.repository.name }}
AWS_ACCESS_KEY_ID: ${{ secrets.S3_UPLOAD_APIKEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_UPLOAD_API_SECRET }}
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
steps:
- uses: actions/[email protected]
- name: Setup Python
uses: actions/[email protected]
with:
python-version: 3.8
- name: Install and run pip-licenses
run: |
pip config set global.extra-index-url https://$PYPI_USERNAME:[email protected]:8081
make install-test
pip install pip-licenses
pip-licenses --format=csv --output-file licence_compliance.csv
- name: Upload S3
# https://github.com/zdurham/s3-upload-github-action
run: |
pip install --quiet --no-cache-dir awscli
mkdir -p ~/.aws
touch ~/.aws/credentials
echo "[default]
aws_access_key_id = ${AWS_ACCESS_KEY_ID}
aws_secret_access_key = ${AWS_SECRET_ACCESS_KEY}" > ~/.aws/credentials
aws s3 cp ${FILE} s3://${S3_BUCKET}/${S3_KEY} --region ${AWS_REGION} $*
rm -rf ~/.aws