Skip to content

Commit

Permalink
Merge branch 'main' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
tmke8 committed Feb 18, 2021
2 parents 04c1e5c + 1ce975b commit 46c338c
Show file tree
Hide file tree
Showing 6 changed files with 607 additions and 91 deletions.
24 changes: 18 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,30 @@ jobs:
ubuntu:

runs-on: ubuntu-latest
env:
POETRY_VIRTUALENVS_CREATE: false

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v1
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install packages
- name: Set up Poetry cache for Python dependencies
uses: actions/cache@v2
if: startsWith(runner.os, 'Linux')
with:
path: ~/.cache/pypoetry
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: ${{ runner.os }}-poetry-
- name: Install Poetry
run: |
python -m pip install --upgrade pip
pip install black mypy pytest isort
pip install -e .
curl -fsS -o get-poetry.py https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py
python get-poetry.py -y
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
rm get-poetry.py
- name: Install dependencies
run: poetry install --no-interaction
- name: Format with black
run: |
python -m black --check .
Expand Down
54 changes: 0 additions & 54 deletions make_release.py

This file was deleted.

34 changes: 34 additions & 0 deletions make_release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash

if [ -n "$(git status --porcelain)" ]; then
echo "repository is dirty"
exit 1
fi

if [ $(git symbolic-ref --short -q HEAD) != "main" ]; then
echo "not on main branch"
exit 2
fi

# ensure main branch is up-to-date
git pull

# merge main into release branch
git checkout release
git merge --no-ff main --no-edit

# bump patch version (e.g. from 0.1.3 to 0.1.4)
poetry version patch

# commit change
git add pyproject.toml
git commit -m "Bump version"

# create tag and push
new_tag=v$(poetry version -s)
echo New tag: $new_tag
git tag $new_tag
git push origin release $new_tag

# clean up
git checkout main
Loading

0 comments on commit 46c338c

Please sign in to comment.