Skip to content

Commit

Permalink
Use GH CI
Browse files Browse the repository at this point in the history
  • Loading branch information
rsheeter committed Sep 9, 2021
1 parent 9660cfc commit d26fe77
Show file tree
Hide file tree
Showing 5 changed files with 122 additions and 26 deletions.
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
open-pull-requests-limit: 10
108 changes: 108 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: Continuous Test + Deploy

on:
push:
branches: [main]
tags: ["v*.*.*"]
pull_request:
branches: [main]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
# pytype currently doesn't work with python >= 3.9
python-version: 3.8
# - name: Install tox
# run: pip install tox
# - name: Run style and typing checks
# run: tox -e lint
test:
runs-on: ${{ matrix.platform }}
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
platform: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Requirements
run: pip install -r requirements.txt
- name: Install
run: pip install -e .
- name: Run the tests
run: ./precommit.sh
deploy:
# only run if the commit is tagged...
if: startsWith(github.ref, 'refs/tags/v')
# ... and both the lint and test jobs completed successfully
needs:
- lint
- test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
# setuptools_scm requires the git clone to not be 'shallow'
fetch-depth: 0
- 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: Extract release notes from annotated tag message
id: release_notes
env:
# e.g. v0.1.0a1, v1.2.0b2 or v2.3.0rc3, but not v1.0.0
PRERELEASE_TAG_PATTERN: "v[[:digit:]]+\\.[[:digit:]]+\\.[[:digit:]]+([ab]|rc)[[:digit:]]+"
run: |
# GH checkout action doesn't preserve tag annotations, we must fetch them
# https://github.com/actions/checkout/issues/290
git fetch --tags --force
# strip leading 'refs/tags/' to get the tag name
TAG_NAME="${GITHUB_REF##*/}"
# Dump tag message to temporary .md file (excluding the PGP signature at the bottom)
TAG_MESSAGE=$(git tag -l --format='%(contents)' $TAG_NAME | sed -n '/-----BEGIN PGP SIGNATURE-----/q;p')
echo "$TAG_MESSAGE" > "${{ runner.temp }}/release_notes.md"
# if the tag has a pre-release suffix mark the Github Release accordingly
if egrep -q "$PRERELEASE_TAG_PATTERN" <<< "$TAG_NAME"; then
echo "Tag contains a pre-release suffix"
echo "IS_PRERELEASE=true" >> "$GITHUB_ENV"
else
echo "Tag does not contain pre-release suffix"
echo "IS_PRERELEASE=false" >> "$GITHUB_ENV"
fi
- name: Create GitHub release
id: create_release
uses: actions/create-release@v1
env:
# This token is provided by Actions, you do not need to create your own token
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body_path: "${{ runner.temp }}/release_notes.md"
draft: false
prerelease: ${{ env.IS_PRERELEASE }}
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
if [ "$IS_PRERELEASE" == true ]; then
echo "DEBUG: This is a pre-release"
else
echo "DEBUG: This is a final release"
fi
python setup.py sdist bdist_wheel
twine upload dist/*
23 changes: 0 additions & 23 deletions .travis.yml

This file was deleted.

5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[![Travis Build Status](https://travis-ci.org/googlefonts/nototools.svg?branch=master)](https://travis-ci.org/googlefonts/nototools)
[![CI Build Status](https://github.com/googlefonts/nototools/workflows/Continuous%20Test%20+%20Deploy/badge.svg)](https://github.com/googlefonts/picosvg/actions/workflows/ci.yml?query=workflow%3ATest)
[![PyPI](https://img.shields.io/pypi/v/notofonttools.svg)](https://pypi.org/project/notofonttools/)
[![pyup](https://pyup.io/repos/github/googlefonts/nototools/shield.svg)](https://pyup.io/repos/github/googlefonts/nototools)
[![Dependencies](https://badgen.net/github/dependabot/googlefonts/nototools)](https://github.com/googlefonts/nototools/network/updates)


# Noto Tools

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ regex==2020.5.14
scour==0.37
six==1.15.0
toml==0.10.1
typed-ast==1.4.1
typed-ast>=1.4.2
ufonormalizer==0.4.1
ufoProcessor==1.9.0
unicodedata2==13.0.0.post2
Expand Down

0 comments on commit d26fe77

Please sign in to comment.