-
Notifications
You must be signed in to change notification settings - Fork 6
78 lines (64 loc) · 1.9 KB
/
release.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Test & Publish PyPi release
on:
workflow_dispatch: null
release:
types: [created]
jobs:
test-pypi:
name: Test PyPi release
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Set up python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Upgrade pip
run: python -m pip install --upgrade pip build
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Create tag
# if present, remove leading `v`
run: |
echo "VERSION_TAG=$(git describe --tags | sed 's/^v//')" >> $GITHUB_ENV
echo ${{ env.VERSION_TAG }}
- name: Build source and binary
run: python -m build --sdist --wheel .
- name: Publish to test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
- name: Sleep
run: sleep 120
- name: Test install from Test PyPI
run: |
pip install \
--index-url https://test.pypi.org/simple/ \
--extra-index-url https://pypi.org/simple \
nebari-workflow-controller==${{ env.VERSION_TAG }}
release-pypi:
name: Publish Nebari-Workflow-Controller on PyPi
runs-on: ubuntu-latest
needs: test-pypi
permissions:
id-token: write
contents: read
steps:
- name: Set up python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Upgrade pip
run: python -m pip install --upgrade pip build
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Build source and binary
run: python -m build --sdist --wheel .
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1