-
Notifications
You must be signed in to change notification settings - Fork 26
50 lines (41 loc) · 1.3 KB
/
test_release_publish.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
name: Build, Test, Publish Github and PyPI Releases
on:
workflow_dispatch:
jobs:
publish_github_release_and_pypi:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install pip and pipenv
run: |
python -m pip install --root-user-action=ignore --upgrade pip
pip install --root-user-action=ignore pipenv
make venv
- name: Build Release tar.gz
run: |
pipenv run python setup.py sdist
- name: Install Build and Run PAT Tests
run: |
pipenv run pip install --root-user-action=ignore dist/panther_analysis_tool-*.tar.gz
pipenv run make test
- name: Create Github Release
run: |
export NEW_VERSION=$(cat VERSION)
git config user.name "dac-bot"
git config user.email "[email protected]"
gh release create v$NEW_VERSION dist/* -t v$NEW_VERSION --draft
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to PyPI
run: |
pipenv run twine upload dist/*
env:
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}