Skip to content

Commit

Permalink
giving this a go
Browse files Browse the repository at this point in the history
  • Loading branch information
blefaudeux committed Nov 6, 2024
1 parent 290e106 commit dcf2096
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 1 deletion.
80 changes: 80 additions & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Push to PyPI

on:
release:
types: [published]

pull_request:
branches: ["main"]

jobs:
pypi-publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/datago
permissions:
id-token: write
steps:
- uses: actions/checkout@v4

- name: Install linux deps
run: |
sudo apt-get update
sudo apt-get -y install libvips-dev libjpeg-turbo8-dev
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.23"

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.11.10"

- name: Install pybindgen
run: |
python3 -m pip install pybindgen
go install golang.org/x/tools/cmd/goimports@latest
go install github.com/go-python/gopy@latest
- name: Build python module
run: |
cd pkg
gopy pkg -author="Photoroom" -email="[email protected]" -name="datago" .
export DESTINATION="../build"
mkdir -p $DESTINATION/datago
mv datago/* $DESTINATION/datago/.
mv setup.py $DESTINATION/.
mv Makefile $DESTINATION/.
mv README.md $DESTINATION/.
rm LICENSE MANIFEST.in
ls
cd ../build
- name: Install python module
run: |
ls
cd build
python3 -m pip install --user -v -e .
- name: Run the python unit tests
env:
DATAROOM_API_KEY: ${{ secrets.DATAROOM_API_KEY }}
DATAROOM_TEST_SOURCE: ${{ secrets.DATAROOM_TEST_SOURCE }}
DATAROOM_API_URL: ${{ secrets.DATAROOM_API_URL }}
run: |
ls
python3 -m pip install -r requirements.txt
pytest -xv python/tests/*
- name: Build the package
run: |
cd build
python3 setup.py sdist
mv dist/* ../.
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "datago"
version = "0.0.1"
version = "0.6"
authors = [
{ name="Photoroom", email="[email protected]" },
]
Expand Down

0 comments on commit dcf2096

Please sign in to comment.