-
Notifications
You must be signed in to change notification settings - Fork 5
70 lines (63 loc) · 1.87 KB
/
release_package.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
name: Release (Upload to Packages)
on:
workflow_dispatch:
inputs:
branch:
description: "The branch, tag or SHA to release from"
required: true
default: "release-fix"
push:
branches: [release-fix]
paths:
- ".github/workflows/release_package.yml"
jobs:
pure-built-distribution:
name: Build pure wheel
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch }}
- uses: actions/setup-python@v5
with:
python-version: 3.9
- run: python -m pip install -U pip setuptools wheel
- run: python setup.py bdist_wheel
- uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: ./dist/*.whl
source-distribution:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch }}
- uses: actions/setup-python@v5
with:
python-version: 3.9
- run: python setup.py sdist
- uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: dist
publish:
needs:
- pure-built-distribution
- source-distribution
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
- run: ls -l dist
- name: Set-up Python
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Install twine
run: python -m pip install twine
- name: Upload Python Client on Packages
run: python -m twine upload --repository-url https://packages.nuxeo.com/repository/pypi-public/ -u "${{ secrets.PACKAGE_USERNAME }}" -p "${{ secrets.PACKAGE_TOKEN }}" dist/*