From 81490fe073eb54effa1d67d82d966ef6f09fc84f Mon Sep 17 00:00:00 2001 From: eheinrich Date: Wed, 27 Jan 2021 13:26:25 -0800 Subject: [PATCH] Initial commit of gh build file --- .github/workflows/build.yaml | 62 ++++++++++++++++++++++++++++++++++++ setup.py | 3 +- 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..db644c8 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,62 @@ +name: Build + +on: + # Run this workflow for pushes on all branches + push: + branches: + - '**' + # Run this workflow when a tag or branch is created + create: + +jobs: + run_tests: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [2.7, 3.6, 3.7, 3.8, 3.9] + steps: + - name: Check out repository + uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.pip + pip install -r test_requirements.pip + pip install coveralls + - name: Run tests + run: nosetests --with-coverage + - name: Coveralls report + run: coveralls --service=github + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + publish_to_pypi: + # Only run this job if the run_tests job has succeeded, and if + # this workflow was triggered by the creation of a new tag + needs: run_tests + if: github.event_name == 'create' && github.event.ref_type == 'tag' && github.event.repository.fork == false + runs-on: ubuntu-latest + steps: + - name: Check out repository + uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + - name: Build package and publish to PyPI + env: + TWINE_USERNAME: __token__ + # TODO: Set this to secrets.PYPI_RISE_SET_API_TOKEN when done testing + TWINE_PASSWORD: ${{ secrets.TEST_PYPI_TOKEN }} + run: | + python setup.py sdist bdist_wheel + # TODO: Remove this repository flag when done testing + twine upload --repository testpypi dist/* diff --git a/setup.py b/setup.py index 3b4f195..896e54f 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,8 @@ setup( name = 'ocs-rise-set', - version = '0.5.1', + # Set this version back to 0.5.1 when done testing + version = '0.0.1', description = 'Routines for accurate rise/set/transit calculations', author = 'Eric Saunders', author_email = 'esaunders@lcogt.net',