-
Notifications
You must be signed in to change notification settings - Fork 101
78 lines (74 loc) · 2.49 KB
/
publish.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: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI
on:
push:
branches:
- release/test-uploaded
- release/test
- release/main
workflow_dispatch:
jobs:
publish-to-testpypi:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Install setuptools and wheel
run: |
python -m pip install --user setuptools wheel
- name: Build a binary wheel and a source tarball
run: |
python setup.py bdist_wheel
python setup.py sdist
# TODO: switch to pep517
- name: Publish distribution 📦 to Test PyPI
if: >-
(github.ref == 'refs/heads/release/test') ||
(github.ref == 'refs/heads/release/main')
uses: pypa/gh-action-pypi-publish@37f50c210e3d2f9450da2cd423303d6a14a6e29f # v1.5.1
with:
password: ${{ secrets.test_pypi_password }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true
test-uploaded:
needs: publish-to-testpypi
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Set up Julia
uses: julia-actions/setup-julia@v1
with:
version: '1.6'
- name: Install tox
run: python -m pip install --user tox
- run: cd ci/test-upload && python -m tox
publish-to-pypi:
needs: test-uploaded
runs-on: ubuntu-20.04
strategy:
matrix: # using `matrix` to define a constant
package: ['julia==0.6.2']
steps:
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Install setuptools and wheel
run: |
python -m pip install --user setuptools wheel
- name: Download from TestPyPI
run: |
pip download --dest dist --no-deps --index-url https://test.pypi.org/simple/ ${{ matrix.package }}
pip download --dest dist --no-deps --index-url https://test.pypi.org/simple/ ${{ matrix.package }} --no-binary :all:
- run: ls -lh dist
- name: Publish distribution 📦 to PyPI
if: github.ref == 'refs/heads/release/main'
uses: pypa/gh-action-pypi-publish@37f50c210e3d2f9450da2cd423303d6a14a6e29f # v1.5.1
with:
password: ${{ secrets.pypi_password }}