Skip to content

Commit

Permalink
update core commit; create patch workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarlevin committed Oct 27, 2022
1 parent 651ce37 commit b19e763
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 1 deletion.
93 changes: 93 additions & 0 deletions .github/workflows/patch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: deploy-patch

on:
# Currently this workflow only runs when triggered manually. Perhaps we can set it up to run when a tag is pushed. Or when a release is made. Or that it could create a release, on a release it can create a tag?
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
test:
name: Run tests
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10']
poetry-version: ['1.1.13']
os: [ubuntu-latest, windows-latest]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install poetry ${{ matrix.poetry-version }}
run: |
python -m ensurepip
python -m pip install --upgrade pip
python -m pip install poetry==${{ matrix.poetry-version }}
- name: Install dependencies
shell: bash
run: |
python -m poetry install
python -m poetry run python scripts/fetch_core.py
python -m poetry run python scripts/zip_templates.py
- name: Test with pytest
run: |
python -m poetry run pytest -v
deploy:
needs: test
name: Deploy to pypi
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

# Sets up python3
- uses: actions/setup-python@v2
with:
python-version: 3.8.5

# Setup poetry
- name: Install poetry
run: |
ensurepip
pip install --upgrade pip
pip install poetry
- name: Install dependencies
shell: bash
run: poetry install

- name: Build package
run: poetry run python scripts/build_package.py

- name: Publish
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
poetry config pypi-token.pypi $PYPI_TOKEN
poetry publish --build
- name: Update version
run: poetry version patch

- name: setup git config
run: |
# setup the username and email.
git config user.name "GitHub Actions Bot"
git config user.email "<>"
- name: commit
run: |
# Stage the file, commit and push
git add pyproject.toml
git commit -m "bump version to next patch level for nightlies"
git push origin main
2 changes: 1 addition & 1 deletion pretext/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
VERSION = get_version('pretext', Path(__file__).parent.parent)


CORE_COMMIT = "ebd94b8ed16f32563c085f189c495bc6bc54324d"
CORE_COMMIT = "030d676d9c2c8799347df1f6c0014f95cecd44f0"


def activate():
Expand Down

0 comments on commit b19e763

Please sign in to comment.