Skip to content

Commit

Permalink
Merge pull request #124 from jGaboardi/update_GHA
Browse files Browse the repository at this point in the history
Update GHA, etc.
  • Loading branch information
jGaboardi authored Jul 8, 2021
2 parents fa5c2b3 + 8bf75ea commit 8ec7f95
Show file tree
Hide file tree
Showing 14 changed files with 470 additions and 459 deletions.
105 changes: 52 additions & 53 deletions .github/workflows/release_and_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,66 +3,65 @@
# in this project's top-level directory, and also on-line at:
# https://github.com/ipums/nhgisxwalk

name: release_and_publish
name: Release & Publish

on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
workflow_dispatch:
inputs:
version:
description: Manual CI Reason
default: test
required: false

jobs:
build:
name: Create release & publish to PyPI
runs-on: ubuntu-latest
steps:
- 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 jupyter urllib3 pandas pyyaml
python setup.py sdist bdist_wheel
- name: Run Changelog
run: |
jupyter nbconvert --to notebook --execute --inplace --ExecutePreprocessor.timeout=-1 --ExecutePreprocessor.kernel_name=python3 tools/gitcount.ipynb
- name: Cat Changelog
uses: pCYSl5EDgo/cat@master
id: changetxt
with:
path: ./tools/changelog.md
env:
TEXT: ${{ steps.changetxt.outputs.text }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # token is provided by GHA, DO NOT create
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: ${{ steps.changetxt.outputs.text }}
draft: false
prerelease: false
- name: Get Asset name
run: |
export PKG=$(ls dist/)
set -- $PKG
echo "whl_path=1" >> $GITHUB_ENV
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/${{ env.whl_path }}
asset_name: ${{ env.whl_path }}
asset_content_type: application/zip
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
- name: Checkout repo
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 jupyter urllib3 pandas pyyaml
python setup.py sdist bdist_wheel
- name: run Changelog
run: |
jupyter nbconvert --to notebook --execute --inplace --ExecutePreprocessor.timeout=-1 --ExecutePreprocessor.kernel_name=python3 tools/gitcount.ipynb
- name: cat Changelog
uses: pCYSl5EDgo/cat@master
id: changetxt
with:
path: ./tools/changelog.md
env:
TEXT: ${{ steps.changetxt.outputs.text }}

- name: Get the tag name
run: echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV

- name: Release
uses: softprops/action-gh-release@v1
with:
body: ${{ steps.changetxt.outputs.text }}
body_path: ${{ steps.changetxt.outputs.path }}
name: Release ${{ env.TAG }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
8 changes: 7 additions & 1 deletion .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
- '*'
schedule:
- cron: '59 23 * * *'
workflow_dispatch:
inputs:
version:
description: Manual CI Reason
default: test
required: false

jobs:
unittests:
Expand All @@ -21,7 +27,7 @@
strategy:
matrix:
os: ['macos-latest', 'ubuntu-latest', 'windows-latest']
environment-file: [ci/36.yaml, ci/37.yaml, ci/38.yaml, ci/39.yaml]
environment-file: [ci/37.yaml, ci/38.yaml, ci/39.yaml]
steps:
- name: checkout repo
uses: actions/checkout@v2
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/ambv/black
rev: stable
- repo: https://github.com/psf/black
rev: 20.8b1
hooks:
- id: black
language_version: python3.8
language_version: python3.9
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ This pacakge allows for the generation of temporal crosswalks of census geograph

## Installation

Currently `nhgisxwalk` officially supports Python [3.6](https://docs.python.org/3.6/), [3.7](https://docs.python.org/3.7/), [3.8](https://docs.python.org/3.8/), and [3.9](https://docs.python.org/3.9/). Please make sure that you are operating in a Python >= 3.6 environment. Install the most current development version of `nhgisxwalk` by running:
Currently `nhgisxwalk` officially supports Python [3.7](https://docs.python.org/3.7/), [3.8](https://docs.python.org/3.8/), and [3.9](https://docs.python.org/3.9/). Please make sure that you are operating in a Python >= 3.7 environment. Install the most current development version of `nhgisxwalk` by running:

```
$ pip install git+https://github.com/ipums/nhgisxwalk
Expand Down
18 changes: 0 additions & 18 deletions ci/36.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# https://github.com/ipums/nhgisxwalk
codecov:
notify:
after_n_builds: 9
after_n_builds: 3
coverage:
range: 50...90
round: nearest
Expand All @@ -22,5 +22,5 @@ coverage:
comment:
layout: "reach, diff, files"
behavior: once
after_n_builds: 9
after_n_builds: 3
require_changes: true
4 changes: 2 additions & 2 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
- conda-forge
dependencies:
- python=3.9
- geopandas
- descartes
- geopandas>=0.9.0
- ipython
- jupyter
- matplotlib
- nb_conda_kernels
- pandas
- pygeos
- pip
- shapely
- watermark
Expand Down
2 changes: 1 addition & 1 deletion nhgisxwalk/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.1.0"
__version__ = "0.1.1"
"""
# `nhgisxwalk` --- IPUMS/NHGIS Census Crosswalk and Atom Generator
Expand Down
Loading

0 comments on commit 8ec7f95

Please sign in to comment.