-
Notifications
You must be signed in to change notification settings - Fork 3
62 lines (58 loc) · 1.82 KB
/
package.yaml
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
51
52
53
54
55
56
57
58
59
60
61
62
name: Publish to PyPI
on:
push:
branches: [ "main" ]
release:
types: [published]
pull_request:
branches: [develop, main]
permissions:
contents: read
jobs:
deploy:
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'
- name: Install dependencies
run: |
# python -m pip install --upgrade pip
pip install hatch
- name: Build package
run: hatch build
# Install Minikube
- name: Install Minikube
run: |
sudo apt-get update -y
sudo apt-get install -y apt-transport-https
sudo curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube
# Start Minikube
- name: Start Minikube
run: |
minikube start --driver=docker --memory=6500
# Set and export KUBECONFIG path
- name: Set KUBECONFIG path
run: |
cp ~/.kube/config ~/.kube/kubeconfig-t2-dev.yaml
echo "KUBECONFIG=$HOME/.kube/config" >> $GITHUB_ENV
echo "CI_TEST_SKIP=1" >> $GITHUB_ENV
- name: Test package
run: hatch -e test run nose2 --verbose
- name: Publish package distributions to PyPI (main)
if: github.ref == 'refs/heads/main'
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://upload.pypi.org/legacy/
- name: Publish package distributions to PyPI (develop)
if: github.ref == 'refs/heads/develop'
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/