-
Notifications
You must be signed in to change notification settings - Fork 11
51 lines (51 loc) · 1.79 KB
/
Copy pathpython-package.yml
File metadata and controls
51 lines (51 loc) · 1.79 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
name: Python package
on:
push:
branches: [ master ]
tags: '*'
pull_request:
branches: [ master ]
workflow_dispatch:
# Example manual run:
# gh workflow run python-package.yml -f "python_versions=['3.15.0-rc.2']"
inputs:
python_versions:
description: Python versions matrix JSON for manual runs
required: false
default: ''
type: string
jobs:
build-python-package:
if: github.event_name != 'workflow_dispatch'
uses: nion-software/github-workflows/.github/workflows/build-python-package.yml@main
build-python-package-manual-default:
if: github.event_name == 'workflow_dispatch' && inputs.python_versions == ''
uses: nion-software/github-workflows/.github/workflows/build-python-package.yml@main
build-python-package-manual:
if: github.event_name == 'workflow_dispatch' && inputs.python_versions != ''
uses: nion-software/github-workflows/.github/workflows/build-python-package.yml@main
with:
python-versions: ${{ inputs.python_versions }}
pypi-publish:
name: Upload release to PyPI
needs: [build-python-package]
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
environment: release
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- name: Download All Artifacts
uses: actions/download-artifact@v4
- name: Copy files to upload to PyPI to dist.
shell: bash
run: |
mkdir dist
find . -name "*.whl" -exec cp {} dist \;
find . -name "*.tar.gz" -exec cp {} dist \;
ls -lR .
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true
print-hash: true