-
Notifications
You must be signed in to change notification settings - Fork 24
74 lines (60 loc) · 1.98 KB
/
Copy pathrelease-to-pypi.yml
File metadata and controls
74 lines (60 loc) · 1.98 KB
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
# Copyright 2020-2025 The MathWorks, Inc.
# Workflow to test MATLAB-Proxy while releasing to PyPi
name: Release to PyPI
on:
release:
types: [created]
jobs:
call-run-unit-tests:
# Call workflow for running node and python tests
uses: ./.github/workflows/run-unit-tests.yml
generate-code-coverage:
# Generates Code coverage and uploads it
needs: [call-run-unit-tests]
if: success()
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Generate Code Coverage XML
uses: ./.github/actions/generate-code-coverage
with:
codecov-token: ${{ secrets.CODECOV_TOKEN }}
build_and_publish_pypi:
needs: call-run-unit-tests
if: success()
# windows container is not required here
runs-on: ubuntu-latest
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
# Specifying a GitHub environment is optional, but strongly encouraged
environment:
name: release
url: https://pypi.org/project/matlab-proxy
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{github.sha}}
- name: Setup Node.js 24
uses: actions/setup-node@v6
with:
node-version: 24
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install Python build dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade build
python3 -m pip install wheel
shell: bash
- name: Build Source and Binary wheel distributions
run: python3 -m build
shell: bash
- name: Publish to PyPI.
uses: pypa/gh-action-pypi-publish@release/v1
# pypa/gh-action-pypi-publish does not support composite action from v1.12.0 onwards.
# For more information, see : https://github.com/pypa/gh-action-pypi-publish/issues/299