From f9be6afbd99fd82ecf3f9ed52682e02d7bcd71f6 Mon Sep 17 00:00:00 2001 From: Rhett Reisman Date: Tue, 23 Jul 2024 13:11:08 -0500 Subject: [PATCH] Create lambda-layer.yml --- .github/workflows/lambda-layer.yml | 49 ++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/lambda-layer.yml diff --git a/.github/workflows/lambda-layer.yml b/.github/workflows/lambda-layer.yml new file mode 100644 index 0000000..ac35c23 --- /dev/null +++ b/.github/workflows/lambda-layer.yml @@ -0,0 +1,49 @@ +name: Build and Release Lambda Layer + +on: + release: + types: [created] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.11' # Match this to your target Python version + + - name: Install virtualenv and dependencies + run: | + pip install virtualenv + virtualenv venv + source venv/bin/activate + mkdir python + pip install requests coinbase-advancedtrade-python --target ./python + + - name: Package dependencies + run: | + zip -r9 layer.zip python + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false + + - name: Upload Layer to Release + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./layer.zip + asset_name: layer.zip + asset_content_type: application/zip