Skip to content

Commit

Permalink
Merge pull request #2 from rhettre/feature/github-actions
Browse files Browse the repository at this point in the history
Feature/GitHub actions
  • Loading branch information
rhettre authored Aug 17, 2024
2 parents e99089a + 9d99e8e commit d764d61
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 247 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Python Package

on:
release:
types: [published]

permissions:
contents: read

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: List directory contents
run: ls -la

- name: Print working directory
run: pwd

- 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 build
- name: Install project dependencies
run: |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Build package
run: python -m build

- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
47 changes: 47 additions & 0 deletions .github/workflows/release-lambda.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# This workflow will build and upload a Python Lambda Layer when a release is created
# The layer is compatible with AWS Lambda Functions using Python 3.9 and x86_64 architecture
# For more information on Lambda Layers, see: https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html

# Note: This layer is specifically built for Python 3.9 and x86_64 architecture due to the build process.
# If you need layers for different Python versions or architectures, you'll need to modify the build step.

name: Build and Release Lambda Layer

on:
release:
types: [created]

jobs:
build-and-release-layer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install virtualenv
- name: Create Lambda Layer
run: |
virtualenv venv
source venv/bin/activate
mkdir python
echo "coinbase-advancedtrade-python" > requirements.txt
docker run --rm -v "$PWD":/var/task public.ecr.aws/sam/build-python3.9:latest /bin/sh -c "pip install --platform manylinux2014_x86_64 --implementation cp --python 3.9 --only-binary=:all: --upgrade -r requirements.txt -t python"
zip -r layer-python3.9-x86_64.zip python
- name: Upload Layer to Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./layer-python3.9-x86_64.zip
asset_name: layer-python3.9-x86_64.zip
asset_content_type: application/zip
199 changes: 0 additions & 199 deletions alphasquared-documentation.md

This file was deleted.

48 changes: 0 additions & 48 deletions alphasquared-examples.md

This file was deleted.

0 comments on commit d764d61

Please sign in to comment.