From d76cd6f1ea151c5a4ce0f40e779dc5519ced2fb1 Mon Sep 17 00:00:00 2001 From: Rhett Reisman Date: Fri, 26 Jul 2024 23:25:48 -0500 Subject: [PATCH] updated release workflow --- .github/workflows/lambda-layer.yml | 49 -------------------------- .github/workflows/release-workflow.yml | 48 +++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 49 deletions(-) delete mode 100644 .github/workflows/lambda-layer.yml create mode 100644 .github/workflows/release-workflow.yml diff --git a/.github/workflows/lambda-layer.yml b/.github/workflows/lambda-layer.yml deleted file mode 100644 index ac35c23..0000000 --- a/.github/workflows/lambda-layer.yml +++ /dev/null @@ -1,49 +0,0 @@ -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 diff --git a/.github/workflows/release-workflow.yml b/.github/workflows/release-workflow.yml new file mode 100644 index 0000000..7b30e2f --- /dev/null +++ b/.github/workflows/release-workflow.yml @@ -0,0 +1,48 @@ +name: Release Workflow + +on: + push: + tags: + - 'v*' + +jobs: + build-and-release: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Build layer.zip + run: | + zip -r layer.zip coinbase_advancedtrade_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 Release Asset + 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 \ No newline at end of file