Skip to content

Commit

Permalink
promote latest pre release to main (#13)
Browse files Browse the repository at this point in the history
* Pre-release: using pre-release version of solvis (0.12.0-alpha.1)
* Chore/11 dependency config more lenient (#12)
* update tox config; make solvis dependency more lenient; detox
* add scripts to docs; update doc dependencies; update GHA workflows
* changelog
* Bump version: 2.0.3 → 2.0.4
* fix dev workflow triggers
* repair dependency mods
* remove pypi publication step;
---------

Co-authored-by: David Thompson <[email protected]>
  • Loading branch information
chrisbc and DrCuriosity authored Jul 4, 2024
1 parent b756c79 commit df47266
Show file tree
Hide file tree
Showing 14 changed files with 821 additions and 598 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 2.0.3
current_version = 2.0.4
commit = True
tag = True

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Dev workflow

on:
pull_request:
branches: [main, deploy-test]
branches: [main, pre-release]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -11,3 +11,4 @@ jobs:
call-test-workflow:
#https://docs.github.com/en/actions/using-workflows/reusing-workflows#calling-a-reusable-workflow
uses: ./.github/workflows/run-tests.yml
secrets: inherit
71 changes: 71 additions & 0 deletions .github/workflows/publish-static-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5
- name: setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install and configure Poetry
uses: GNS-Science/install-poetry@main
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
#----------------------------------------------
# load cached venv if cache exists
#----------------------------------------------
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}-publish-static-docs
#----------------------------------------------
# install dependencies if cache does not exist
#----------------------------------------------
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: |
poetry install --with doc --extras scripts
- name: Build documentation
run: |
poetry run mkdocs build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./site
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
44 changes: 16 additions & 28 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,22 @@ on:
tags:
- 'v*'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "release"

# call-test-workflow:
# #https://docs.github.com/en/actions/using-workflows/reusing-workflows#calling-a-reusable-workflow
# uses: ./.github/workflows/run-tests.yml
# secrets: inherit

release:
name: Create Release
# needs: call-test-workflow

permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing

runs-on: ubuntu-latest
strategy:
matrix:
python-versions: ["3.9", "3.10"]

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand All @@ -35,35 +39,25 @@ jobs:

- name: Get Changelog Entry
id: changelog_reader
uses: mindsers/changelog-reader-action@v2
uses: GNS-Science/changelog-reader-action@master
with:
validation_depth: 10
version: ${{ steps.tag_name.outputs.current_version }}
path: ./CHANGELOG.md

# run build using the minimum supported python version
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-versions }}
python-version: "3.9"

- name: Install and configure Poetry
uses: snok/install-poetry@v1
uses: GNS-Science/install-poetry@main
with:
# version: 1.2.0b3
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

- name: build documentation
run: |
poetry install -E doc
poetry run mkdocs build
- name: publish documentation
uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ secrets.PERSONAL_TOKEN }}
publish_dir: ./site

- name: Build wheels and source tarball
run: >-
poetry build
Expand All @@ -74,7 +68,7 @@ jobs:
- name: create github release
id: create_release
uses: softprops/action-gh-release@v1
uses: GNS-Science/action-gh-release@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand All @@ -83,9 +77,3 @@ jobs:
draft: false
prerelease: false

- name: publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
skip_existing: true
25 changes: 16 additions & 9 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,18 @@ jobs:
run_unit_tests:
runs-on: ubuntu-latest
timeout-minutes: 10

strategy:
matrix:
python-versions: [3.9, "3.10"]
python-versions: ["3.9", "3.10", "3.11"]
os: [ubuntu-latest, macos-latest, windows-latest]

env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-versions }}
Expand All @@ -37,7 +40,7 @@ jobs:
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}-run-tests

#----------------------------------------------
# install dependencies if cache does not exist
Expand All @@ -55,9 +58,13 @@ jobs:
- name: list files
run: ls -l .

- name: Submit coverage report if this is Linux
if: runner.os == 'Linux'
uses: codecov/codecov-action@v3
- name: Submit coverage report
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: false # optional (default = false)
verbose: true # optional (default = false)
files: ./coverage.xml # optional
flags: unittests # optional
name: codecov-umbrella # optional
token: ${{ secrets.CODECOV_TOKEN }} # required
# verbose: true # optional (default = false)
env_vars: OS,PYTHON
fail_ci_if_error: true # optional (default = false)
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## [2.0.4] - 2024-07-04

### Changed
- update dependencies
- solvis to >=0.11.1
- nzshm-common = "^0.8.1"
- nzshm-model = "^0.10.6"
- move scripts package into solvis_store package
- update testing instructions in README
- remove twine and docs from toc build step
- add python 3.12 to tox setup
- add docs page for scripts

## [2.0.3] - 2024-06-10
### Changed
- update solvis to 0.11.1
Expand Down
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
# Solvis Store


[![pypi](https://img.shields.io/pypi/v/solvis-store.svg)](https://pypi.org/project/solvis-store/)
[![python](https://img.shields.io/pypi/pyversions/solvis-store.svg)](https://pypi.org/project/solvis-store/)
[![Build Status](https://github.com/GNS-Science/solvis-store/actions/workflows/dev.yml/badge.svg)](https://github.com/GNS-Science/solvis-store/actions/workflows/dev.yml)
[![codecov](https://codecov.io/gh/GNS-Science/solvis-store/branch/main/graphs/badge.svg)](https://codecov.io/github/GNS-Science/solvis-store)


* Documentation: <https://GNS-Science.github.io/solvis-store>
* GitHub: <https://github.com/GNS-Science/solvis-store>
* PyPI: <https://pypi.org/project/solvis-store/>
* Free software: GPL-3.0-only

## Features
Expand All @@ -23,7 +19,7 @@ Prereq: make sure poetry can use the `.env` file
poetry self add poetry-dotenv-plugin
```

`poetry run pytest`
`TESTING=1 poetry run pytest`

## Credits

Expand Down
6 changes: 6 additions & 0 deletions docs/scripts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Solvis_store cli script support common data processing operations.

::: mkdocs-click
:module: solvis_store.scripts.cli
:command: cli
:prog_name: CLI
3 changes: 3 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ repo_name: gns-science/solvis-store
#strict: true
nav:
- Home: index.md

- Installation: installation.md
- Scripts: scripts.md
- Usage: usage.md
- Modules: api.md
- Contributing: contributing.md
Expand All @@ -23,6 +25,7 @@ theme:
- navigation.instant
- navigation.tabs.sticky
markdown_extensions:
- mkdocs-click
- pymdownx.emoji:
emoji_index: !!python/name:material.extensions.emoji.twemoji
emoji_generator: !!python/name:material.extensions.emoji.to_svg
Expand Down
Loading

0 comments on commit df47266

Please sign in to comment.