-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (82 loc) · 2.6 KB
/
publish-on-pypi.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
name: Publish on PyPI
on:
release:
types:
- published
jobs:
publish_pypi:
runs-on: ubuntu-latest
if: github.repository == 'osscar-org/jupyterlab-cube' && startsWith(github.ref, 'refs/tags/v')
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -U setuptools
pip install -U invoke
pip install -U jupyter-packaging
pip install -U --upgrade jupyterlab
- name: Update version
run: invoke update-version --version="${GITHUB_REF#refs/tags/}"
- name: Install the node
uses: actions/setup-node@v2
with:
node-version: '16.x'
- run: npm install
- name: Create new tag
run: |
git config --local user.email "[email protected]"
git config --local user.name "OSSCAR Team"
git commit -m "Release ${GITHUB_REF#refs/tags/}" -a
TAG_MSG=.github/static/release_tag_msg.txt
sed -i "s|TAG_NAME|${GITHUB_REF#refs/tags/}|g" "${TAG_MSG}"
git tag -af -F "${TAG_MSG}" ${GITHUB_REF#refs/tags/}
- name: Push release commit and new tag
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
force: true
tags: true
branch: develop
- name: Build source distribution
run: |
jlpm
jlpm run build
python ./setup.py sdist bdist_wheel
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
publish_npm:
needs: publish_pypi
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Setup .npmrc file to publish to npm
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -U setuptools
pip install -U invoke
pip install -U jupyter-packaging
pip install -U --upgrade jupyterlab
- name: Update version
run: invoke update-version --version="${GITHUB_REF#refs/tags/}"
- uses: actions/setup-node@v2
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- run: yarn
- run: yarn publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}