Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GHA release pipeline #226

Closed
wants to merge 5 commits into from
Closed
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
16 changes: 13 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,25 @@ jobs:
uses: actions/setup-python@v4.3.0
with:
python-version: 3.9.15

- name: Install pipenv
run: make install-pipenv
- name: Setup Virtual Environment
run: make venv
run: pip install pipenv

- name: Install Core Utilities
run: make install

- name: Install Dependencies
run: make deps

- name: Install Panther CLI
run: pipenv run -- pip3 install -e .

- name: Run CLI Tests
run: make ci

- name: Test building a release will work
run: |
rm -rf dist
pipenv run python3 setup.py sdist
pipenv run pip install dist/*.tar.gz
pipenv run panther_analysis_tool --version
39 changes: 39 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Release panther_analysis_tool

on:
push:
branches:
- "master"

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.9"

- name: Install pipenv
run: pip install pipenv

- name: Install Core Utilities
run: make install

- name: Clean old release (if any)
run: rm -rf dist

- name: Build release package
run: pipenv run python3 setup.py sdist

- name: Test package works
run: |
pipenv run pip install dist/*.tar.gz
pipenv run panther_analysis_tool --version
make test

- name: Publish to pypi
run: pipenv run twine upload dist/*.tar.gz -u panther -p {{ secrets.PYPI_PASSWORD }} --non-interactive
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ include requirements.txt
include panther_analysis_tool/log_schemas/__init__.py
include panther_analysis_tool/log_schemas/user_defined.py
include panther_analysis_tool/backend/graphql/*.graphql
include VERSION
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ help:
.PHONY: ci
ci: lint test integration

.PHONY: install-pipenv
install-pipenv:
pip install pipenv

.PHONY: deps
deps: ## Install dependencies (including dev dependencies) using pipenv
pipenv install --dev
Expand Down
3 changes: 2 additions & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ verify_ssl = true

[dev-packages]
bandit = "==1.7.0"
black = "==20.8b1"
black = "~=22.10.0"
isort = "==5.8.0"
mypy = "==0.812"
panther-core = "==0.0.10"
Expand All @@ -14,6 +14,7 @@ pyfakefs = "==4.4.0"
nose = "==1.3.7"
PyYAML = "==5.4.1"
coverage = "==6.4.2"
twine = ">=4.0.1"

[packages]
boto3 = "==1.21.42"
Expand Down
Loading