Skip to content

Commit

Permalink
Release automation added (#179)
Browse files Browse the repository at this point in the history
* release files added

* release files updated
  • Loading branch information
ferie24 committed Sep 14, 2022
1 parent c687e35 commit 43b866b
Show file tree
Hide file tree
Showing 5 changed files with 149 additions and 6 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/build.yml
@@ -0,0 +1,26 @@
name: build
on:
workflow_dispatch:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
PACKAGE_DIR: arangopipe
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.7", "3.8", "3.9", "3.10"]
name: Python ${{ matrix.python }}
steps:
- uses: actions/checkout@v2
- name: Setup Python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Setup pip
run: python -m pip install --upgrade pip setuptools wheel
- name: Install packages
run: pip install -r requirements.txt
111 changes: 111 additions & 0 deletions .github/workflows/release.yml
@@ -0,0 +1,111 @@
name: release
on:
workflow_dispatch:
release:
types: [published]
env:
PACKAGE_DIR: arangopipe
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.7", "3.8", "3.9", "3.10"]
name: Python ${{ matrix.python }}
steps:
- uses: actions/checkout@v2
- name: Setup Python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Setup pip
run: python -m pip install --upgrade pip setuptools wheel
- name: Install packages
run: pip install -r requirements.txt

release:
needs: build
runs-on: ubuntu-latest
name: Release package
steps:
- uses: actions/checkout@v2

- name: Fetch complete history for all tags and branches
run: git fetch --prune --unshallow

- name: Setup python
uses: actions/setup-python@v2
with:
python-version: "3.8"

- name: Install release packages
run: pip install setuptools wheel twine setuptools-scm[toml]

- name: Install dependencies
run: pip install -r requirements.txt

- name: Build distribution
run: python setup.py sdist bdist_wheel

- name: Publish to PyPI Test
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD_TEST }}
run: twine upload --repository testpypi dist/* #--skip-existing
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
run: twine upload --repository pypi dist/* #--skip-existing

changelog:
needs: release
runs-on: ubuntu-latest
name: Update Changelog
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Create new branch
run: git checkout -b actions/changelog

- name: Set branch upstream
run: git push -u origin actions/changelog
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Setup python
uses: actions/setup-python@v2
with:
python-version: "3.8"

- name: Install release packages
run: pip install wheel gitchangelog pystache

- name: Set variables
run: echo "VERSION=$(curl ${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/releases/latest | python -c "import sys; import json; print(json.load(sys.stdin)['tag_name'])")" >> $GITHUB_ENV

- name: Generate newest changelog
run: gitchangelog ${{env.VERSION}} > CHANGELOG.md

- name: Make commit for auto-generated changelog
uses: EndBug/add-and-commit@v7
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
add: "CHANGELOG.md"
branch: actions/changelog
message: "!gitchangelog"

- name: Create pull request for the auto generated changelog
run: |
echo "PR_URL=$(gh pr create \
--title "changelog: release ${{env.VERSION}}" \
--body "beep boop, i am a robot" \
--label documentation)" >> $GITHUB_ENV
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Alert developer of open PR
run: echo "Changelog $PR_URL is ready to be merged by developer."
1 change: 0 additions & 1 deletion arangopipe/requirements.txt
@@ -1,5 +1,4 @@
python-arango
arangopipe
pandas
PyYAML==5.1.1
sklearn2
Expand Down
16 changes: 12 additions & 4 deletions arangopipe/setup.py
Expand Up @@ -4,14 +4,20 @@
# The directory containing this file
HERE = pathlib.Path(__file__).resolve().parents[1]


# The text of the README file
README = (HERE / "README.md").read_text()

requirements = ['python-arango',
'pandas',
'PyYAML==5.1.1',
'sklearn2',
'yapf',
'autopep8']

# This call to setup() does all the work
setup(
name="arangopipe",
version="0.0.70.0.0",
version="0.0.70.0.2",
description="package for machine learning meta-data management and analysis",
long_description=README,
long_description_content_type="text/markdown",
Expand All @@ -23,7 +29,9 @@
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7"],
packages=["arangopipe", "arangopipe.arangopipe_storage","arangopipe.arangopipe_analytics"],
packages=["arangopipe", "arangopipe.arangopipe_storage", "arangopipe.arangopipe_analytics"],
package_data={'config': ['arangopipe/arangopipe_storage/arangopipe_config.yaml']},
include_package_data=True
include_package_data=True,
install_requires=requirements,
python_requries=">=3.7"
)
1 change: 0 additions & 1 deletion requirements.txt
@@ -1,5 +1,4 @@
python-arango
arangopipe
pandas
PyYAML==5.1.1
sklearn2
Expand Down

0 comments on commit 43b866b

Please sign in to comment.