Skip to content

Commit 84e6b40

Browse files
chore(TECHOPS-18898): add release pipeine (#6)
* add test pipline to run pytests on every PR * add master pipeline on merge to master to push to pypi
1 parent b54a00d commit 84e6b40

2 files changed

Lines changed: 67 additions & 0 deletions

File tree

.github/workflows/release-test.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Test Release
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
workflow_call:
8+
9+
jobs:
10+
test:
11+
runs-on: large-spot
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Set up Python 3.9
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version: 3.9
19+
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
python -m pip install -r requirements.txt
24+
python -m pip install pytest
25+
26+
- name: Run tests
27+
run: python -m pytest test/model_unit_test.py

.github/workflows/release.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
10+
test:
11+
uses: ./.github/workflows/release-test.yml
12+
13+
release:
14+
name: Release
15+
runs-on: large-spot
16+
needs: test
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: '3.9'
24+
25+
- name: Install build dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
python -m pip install build twine
29+
30+
- name: Build package
31+
run: python -m build
32+
33+
- name: Check distribution
34+
run: twine check dist/*
35+
36+
- name: Publish to PyPI
37+
env:
38+
TWINE_USERNAME: __token__
39+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
40+
run: twine upload dist/*

0 commit comments

Comments
 (0)