diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 73cdca0..f80ece9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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: @@ -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/upload-release-assets@v2.0 + with: + files: '${{ env.ROOT_DIR }}/dist/*' + repo-token: ${{ secrets.ACCESS_TOKEN }} + release-tag: ${{ needs.prepare.outputs.version }} + + - name: Upload package to pypi + uses: pypa/gh-action-pypi-publish@v1.8.3 + 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/upload-release-assets@v2.0 diff --git a/Makefile b/Makefile index 904931b..9c7d855 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -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