-
Notifications
You must be signed in to change notification settings - Fork 9
114 lines (96 loc) · 3.08 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: 'Build and maybe upload to PyPI'
on:
release:
types: [published]
push:
branches: [main]
tags: ['*']
pull_request:
branches:
- main
workflow_dispatch:
env:
PYTHON_VERSION: 3.10
FORCE_COLOR: '1' # Make tools pretty.
jobs:
# Always build & verify extension
build-extension:
name: Build and verify extension
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository 🛎'
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 'Base Setup 🛠'
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- name: 'Install dependencies 📦'
run: python -m pip install -U "jupyterlab>=4"
- name: 'Lint the extension 🧹'
run: |
set -eux
jlpm
jlpm run lint:check
- name: 'Test the extension 🧪'
run: |
set -eux
jlpm run test --passWithNoTests
- name: 'Install extension 🏗'
run: |
set -eux
python -m pip install .
jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "jupyterlab-conda-store.*OK"
python -m jupyterlab.browser_check
- name: 'Package the extension 📦'
run: |
set -eux
python -m pip install build twine
python -m build
twine check dist/*
- name: 'Upload extension packages 📤'
uses: actions/upload-artifact@v4
with:
name: jupyterlab-extension-package
path: dist/
if-no-files-found: error
# Upload to Test PyPI on every push to main
release-test-PiPy:
name: 'Publish in-dev to test.pypi.org 📦'
environment: release-test-pipy
if: github.repository_owner == 'conda-incubator' && github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: build-extension
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- name: 'Download build artefacts 📥'
uses: actions/download-artifact@v4
with:
name: jupyterlab-extension-package
path: dist
- name: 'Upload package to Test PyPI 🚀'
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
print-hash: true
verbose: true
release-pypi:
name: 'Publish released package to pypi.org'
environment: release-pypi
if: github.repository_owner == 'conda-incubator' && github.event_name == 'release' && startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: build-extension
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- name: 'Download build artefacts 📥'
uses: actions/download-artifact@v4
with:
name: jupyterlab-extension-package
path: dist
- name: 'Upload to PyPI 🚀'
uses: pypa/gh-action-pypi-publish@release/v1
with:
print-hash: true
verbose: true