Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build

on:
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install pipenv
run: pip install pipenv

- name: Set up project environment
run: make setup

- name: Build package
run: make build

- name: Build documentation
run: make docs
54 changes: 54 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Release

on:
push:
tags:
- "v*"

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install pipenv
run: pip install pipenv

- name: Set up project environment
run: make setup

- name: Build package
run: make build

- name: Build documentation
run: make docs

- name: Package documentation
run: tar -czf docs.tar.gz -C docs .

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: |
dist/*
docs.tar.gz

- name: Notify cloud-infra repo
env:
GH_TOKEN: ${{ secrets.DOCS_DISPATCH_TOKEN }}
run: |
gh api repos/gormaniac/cloud-infra/dispatches \
-f event_type=doc-release \
-f 'client_payload[tag]=${{ github.ref_name }}' \
-f 'client_payload[repository]=${{ github.repository }}' \
-f 'client_payload[github_sha]=${{ github.sha }}'
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@
build/*
*.egg-info
docs/.buildinfo
docs/.doctrees/
docs/.doctrees/
.pytest_cache/
docs/
dist/
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ install-self: # Install this project's python package using the pipenv's pip
.PHONY: docs
docs: # Build the documentation for this package
pipenv run sphinx-apidoc -T -f -o doc $(PKG_DIR)
pipenv run sphinx-build doc/ docs/
pipenv run sphinx-build -b dirhtml doc/ docs/

.PHONY: clean-py
clean-py: # Clean up Python generated files
Expand All @@ -37,6 +37,8 @@ clean-py: # Clean up Python generated files
clean: clean-py # Remove build files - including a forced "git rm" of "dist/*"
git rm -f dist/* --ignore-unmatch
rm -rf dist
git rm -f docs/* --ignore-unmatch
rm -rf docs

.PHONY: read-docs
read-docs: # Open the package docs locally
Expand All @@ -48,12 +50,12 @@ read-docs: # Open the package docs locally

.PHONY: release
release: change-version clean setup build docs # Build a new versioned release and push it (requires VERSION=#.#.#)
git add dist/* doc/* docs/* pyproject.toml $(PKG_DIR)/__init__.py
git add doc/* pyproject.toml $(PKG_DIR)/__init__.py
git commit -m "build: release v$(VERSION)"
git push
git tag -a v$(VERSION) -m "Release v$(VERSION)"
git push origin v$(VERSION)
$(MAKE) clean-py
$(MAKE) clean

.PHONY: pypi
pypi: # Upload all Python packages in "dist/" to PyPI.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ Supports:
- Profile getting/setting
- Yara rule getting/setting

Read the full documentation [here](https://gormo.co/pyhatching/).
Read the full documentation [here](https://gormo.co/docs/pyhatching/).
Binary file removed dist/pyhatching-0.2.1-py3-none-any.whl
Binary file not shown.
Binary file removed dist/pyhatching-0.2.1.tar.gz
Binary file not shown.
4 changes: 3 additions & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
copyright = "2023, John Gorman"
author = "John Gorman"

extensions = ["sphinx.ext.autodoc", "sphinx.ext.githubpages"]
extensions = ["sphinx.ext.autodoc"]

templates_path = ["_templates"]
exclude_patterns = []


html_theme = "sphinx_rtd_theme"
html_static_path = []

html_baseurl = 'https://gormo.co/docs/caic-python/'
Empty file removed docs/.nojekyll
Empty file.
13 changes: 0 additions & 13 deletions docs/_sources/index.rst.txt

This file was deleted.

45 changes: 0 additions & 45 deletions docs/_sources/pyhatching.rst.txt

This file was deleted.

123 changes: 0 additions & 123 deletions docs/_static/_sphinx_javascript_frameworks_compat.js

This file was deleted.

Loading
Loading