-
Notifications
You must be signed in to change notification settings - Fork 2
55 lines (53 loc) · 1.99 KB
/
primary.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Pre-Release
on:
pull_request:
branches:
- primary
jobs:
Primary-Merge-Checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install and set up Poetry
run: |
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py >> install-poetry.py
python install-poetry.py
- name: Set up cache
uses: actions/cache@v1
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
- name: Upgrade pip
run: |
poetry run python -m pip install pip -U
- name: Install dependencies
run: |
poetry install -vvv
- name: Get latest PyPI version
run: |
export PYPI_JSON=$(curl https://pypi.org/pypi/snappiershot/json)
echo ${PYPI_JSON} | python -m json.tool
PYPI_VERSION=$(python -c "import json; import os; data = json.loads(os.getenv('PYPI_JSON')); print(sorted(data['releases'].keys())[-1])")
echo "PYPI_VERSION=${PYPI_VERSION}"
echo "PYPI_VERSION=${PYPI_VERSION}" >> $GITHUB_ENV
- name: Get current package version
run: |
PACKAGE_VERSION=$(poetry run python -c "import snappiershot; print(snappiershot.__version__)")
echo "PACKAGE_VERSION=${PACKAGE_VERSION}"
echo "PACKAGE_VERSION=${PACKAGE_VERSION}" >> $GITHUB_ENV
# Check that the version of the package has been bumped.
- name: Check version bump
run: |
echo "Checking: ${PACKAGE_VERSION} != ${PYPI_VERSION}"
if [ $PACKAGE_VERSION = $PYPI_VERSION ] ;
then
exit 1
fi
# Check that the changelog has been updated.
- name: Check changelog
run: |
cat CHANGELOG.md | grep -F "## v${PACKAGE_VERSION}" || false