Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create licenses.yml #287

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/licenses.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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