Skip to content

Commit b5b5616

Browse files
prabhakk-mwPrabhakar Kumar
authored andcommitted
Updates github/workflows to use trusted publishing to PyPI.
1 parent f7a6527 commit b5b5616

File tree

6 files changed

+25
-25
lines changed

6 files changed

+25
-25
lines changed

.github/workflows/release.yml renamed to .github/workflows/publish-jupyter-matlab-proxy.yml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,28 @@
11
# Copyright 2020-2024 The MathWorks, Inc.
22

3-
# Workflow to release MATLAB Jupyter Integration to PyPi
4-
name: Release to PyPI
5-
3+
name: Publish jupyter-matlab-proxy to PyPI
64
on:
75
release:
86
types: [created]
97

108
jobs:
119
call-unit-tests:
12-
# Runs unit tests
10+
# Only run release jobs on tags which have `jupyter-matlab-proxy` in them
11+
if: ${{ contains(github.ref, 'jupyter-matlab-proxy') }}
12+
# Run unit tests
1313
uses: ./.github/workflows/run-unit-tests.yml
1414
secrets: inherit
1515

1616
build_and_publish_pypi:
17-
# TODO: Add integration-tests as a dependency to
18-
# the release pipeline.
1917
needs: [call-unit-tests]
2018
if: success()
2119
runs-on: ubuntu-latest
20+
permissions:
21+
# IMPORTANT: this permission is mandatory for trusted publishing
22+
id-token: write
23+
environment:
24+
name: pypi
25+
url: https://pypi.org/project/jupyter-matlab-proxy
2226

2327
steps:
2428
- name: Checkout
@@ -40,9 +44,4 @@ jobs:
4044
run: python3 -m hatch build -t wheel
4145

4246
- name: Publish to PyPI.
43-
uses: pypa/gh-action-pypi-publish@release/v1
44-
with:
45-
user: __token__
46-
verbose: true
47-
password: ${{ secrets.PYPI_TOKEN }}
48-
repository-url: ${{ secrets.PYPI_REPOSITORY_URL }}
47+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/run-e2e-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Copyright 2023-2024 The MathWorks, Inc.
22

3-
name: End-to-End Tests for Jupyter Integration for MATLAB
3+
name: End-to-End Tests for MATLAB Integration for Jupyter
44
on:
55
workflow_call:
66

.github/workflows/run-integration-tests.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Copyright 2023-2024 The MathWorks, Inc.
22

3-
# Workflow that contains jobs to test MATLAB Jupyter Integration
4-
name: Integration testing MATLAB Jupyter Integration
3+
name: Integration testing MATLAB Integration for Jupyter
54

65
on:
76
# Reusable workflow

.github/workflows/run-unit-tests.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Copyright 2020-2024 The MathWorks, Inc.
22

3-
# Workflow that contains jobs to test MATLAB Jupyter Integration
4-
name: Unit Testing MATLAB Jupyter Integration
3+
name: Unit Testing MATLAB Integration for Jupyter
54

65
on:
76
# Reusable workflow
Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,29 @@
1-
# Copyright 2020-2023 The MathWorks, Inc.
1+
# Copyright 2020-2024 The MathWorks, Inc.
22

3-
# Workflow that contains jobs to test MATLAB Jupyter Integration
4-
name: Testing MATLAB Jupyter Integration
3+
name: Testing MATLAB Integration for Jupyter
54

65
on:
76
workflow_dispatch:
87
push:
98
branches:
109
- "main"
11-
10+
paths:
11+
# Only run tests when there are changes to these folders
12+
- "src/**"
13+
- "tests/**"
14+
- "setup.py"
1215
jobs:
1316
call-unit-tests:
14-
# Runs unit tests
17+
# Run unit tests
1518
uses: ./.github/workflows/run-unit-tests.yml
1619
secrets: inherit
1720

1821
call-integration-tests:
19-
# Runs integration tests
22+
# Run integration tests
2023
uses: ./.github/workflows/run-integration-tests.yml
2124
secrets: inherit
2225

2326
call-e2e-tests:
24-
# Runs the end-to-end tests
27+
# Run the end-to-end tests
2528
uses: ./.github/workflows/run-e2e-tests.yml
2629
secrets: inherit

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# MATLAB Integration _for Jupyter_
22

3-
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/mathworks/jupyter-matlab-proxy/run-tests.yml?branch=main&logo=github)](https://github.com/mathworks/jupyter-matlab-proxy/actions) [![PyPI badge](https://img.shields.io/pypi/v/jupyter-matlab-proxy.svg?logo=pypi)](https://pypi.python.org/pypi/jupyter-matlab-proxy) [![codecov](https://codecov.io/gh/mathworks/jupyter-matlab-proxy/branch/main/graph/badge.svg?token=ZW3SESKCSS)](https://codecov.io/gh/mathworks/jupyter-matlab-proxy)
3+
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/mathworks/jupyter-matlab-proxy/test-jupyter-matlab-proxy.yml?branch=main&logo=github)](https://github.com/mathworks/jupyter-matlab-proxy/actions) [![PyPI badge](https://img.shields.io/pypi/v/jupyter-matlab-proxy.svg?logo=pypi)](https://pypi.python.org/pypi/jupyter-matlab-proxy) [![codecov](https://codecov.io/gh/mathworks/jupyter-matlab-proxy/branch/main/graph/badge.svg?token=ZW3SESKCSS)](https://codecov.io/gh/mathworks/jupyter-matlab-proxy)
44

55

66
Run MATLAB® code in Jupyter® environments such as Jupyter notebooks, JupyterLab, and JupyterHub.

0 commit comments

Comments
 (0)