Skip to content

Commit 456d3e3

Browse files
committed
deploy package on pypi only after succesful test
1 parent b28724b commit 456d3e3

2 files changed

Lines changed: 16 additions & 14 deletions

File tree

.github/workflows/pypi-release.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
name: Publish DaC package
2-
run-name: ${{ github.actor }} is releasing dac ${{ github.ref }} 🚀
1+
name: Build the DaC package
2+
run-name: ${{ github.actor }} is building the dac package 📦 (${{ github.event_name }})
3+
34
on:
45
workflow_run:
5-
workflows: ["Test DaC"]
6-
types: ["completed"]
7-
push:
8-
tags:
9-
- v*
6+
workflows: ["Test DaC"]
7+
typtypes: ["completed"]
8+
109
jobs:
1110
release:
1211
runs-on: ubuntu-latest
1312
steps:
1413
- name: Checkout 🔖
14+
if: ${{ github.event_name == 'release' }}
1515
uses: actions/checkout@v3
1616
with:
1717
fetch-depth: 1
@@ -23,10 +23,12 @@ jobs:
2323
run: |
2424
python -m venv venv || . venv/bin/activate
2525
pip install -U pip wheel setuptools build twine
26-
- name: Script 🏃‍♂️
26+
- name: Build 🛠️📦
27+
run: |
28+
python -m build
29+
- name: Deploy to PyPy 📦🚀
2730
env:
2831
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
2932
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
3033
run: |
31-
python -m build
3234
python -m twine upload dist/*

.github/workflows/test.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Test DaC
22
run-name: ${{ github.actor }} is testing out dac 🚀
3-
on:
3+
on:
44
push:
55
paths:
66
- src/*
@@ -35,6 +35,10 @@ jobs:
3535
pre-commit run
3636
test:
3737
runs-on: "${{ matrix.os }}"
38+
strategy:
39+
matrix:
40+
os: ["ubuntu-latest"]
41+
version: ["3.9", "3.10", "3.11"]
3842
steps:
3943
- name: Checkout 🔖
4044
uses: actions/checkout@v3
@@ -52,7 +56,3 @@ jobs:
5256
- name: Script 🏃‍♂️
5357
run: |
5458
pytest test --run-slow
55-
strategy:
56-
matrix:
57-
os: ["ubuntu-latest"]
58-
version: ["3.9", "3.10", "3.11"]

0 commit comments

Comments
 (0)