Skip to content

Commit

Permalink
fix(actions): add datascience package to makefile and CI
Browse files Browse the repository at this point in the history
  • Loading branch information
vascoalramos committed Mar 27, 2023
1 parent 0990b5b commit 307c2a0
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 7 deletions.
47 changes: 44 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ jobs:
run: echo ::set-output name=value::${GITHUB_REF#refs/*/}


build-upload:
name: Build and Upload
build-core:
name: Build core package
runs-on: ubuntu-20.04

needs:
Expand All @@ -47,7 +47,48 @@ jobs:
- name: Build
run: |
echo "${{ needs.prepare.outputs.version }}" > VERSION
cd $ROOT_DIR && python setup.py bdist_wheel
make build-core PYTHON=python
- name: Upload release assets
uses: AButler/[email protected]
with:
files: '${{ env.ROOT_DIR }}/dist/*'
repo-token: ${{ secrets.ACCESS_TOKEN }}
release-tag: ${{ needs.prepare.outputs.version }}

- name: Upload package to pypi
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages_dir: '${{ env.ROOT_DIR }}/dist/'


build-datascience:
name: Build datascience package
runs-on: ubuntu-20.04

needs:
- prepare

env:
ROOT_DIR: src/datascience

steps:
- uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.8'

- name: Install build dependencies
run: python -m pip install --upgrade pip wheel

- name: Build
run: |
echo "${{ needs.prepare.outputs.version }}" > VERSION
make build-datascience PYTHON=python
- name: Upload release assets
uses: AButler/[email protected]
Expand Down
29 changes: 25 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,30 @@ define UPLOAD
cd src/$1/ && $(PYTHON) -m twine upload -r ydata dist/*
endef

build: ### Build package
build-core:
$(call BUILD,core)

upload: ### Upload build package into pypi
build-datascience:
$(call BUILD,datascience)

build-all: build-core build-datascience ### Build all packages

upload-core:
$(call UPLOAD,core)

lint: ### Run prospector
upload-datascience:
$(call UPLOAD,datascience)

upload-all: upload-core upload-datascience ### Upload all packages to pypi

lint-core: ### Run prospector
$(PYTHON) -m prospector src/core

lint-datascience: ### Run prospector
$(PYTHON) -m prospector src/datascience

lint: lint-core lint-datascience ### Run prospector on all packages

define LINK_LOCAL
$(PIP) install -e src/$1
endef
Expand All @@ -64,5 +79,11 @@ link-core:
echo "0.0.0" > src/core/VERSION
$(call LINK_LOCAL,core)

test: link-core ### Runs the tests
link-datascience:
echo "0.0.0" > src/datascience/VERSION
$(call LINK_LOCAL,datascience)

link-all: link-core link-datascience ### Link all packages

test: link-all ### Runs the tests
$(PYTHON) -m pytest src/core

0 comments on commit 307c2a0

Please sign in to comment.