-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (103 loc) · 3.66 KB
/
tag-testpypi.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: Publish Python 🐍 distributions 📦 to TestPyPI
on:
push:
tags:
- 'v*.*.*'
permissions:
contents: read
jobs:
# Wheels no longer offered until library linking is clarified.
build:
name: Build Source distribution and Wheels
runs-on: ${{ matrix.os }}
strategy:
# fail-fast: false
matrix:
# os: [ "ubuntu-latest", "macos-latest", "windows-latest" ]
# python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ]
include:
- os: ubuntu-latest
python-version: "3.x"
defaults:
run:
shell: bash -l {0}
steps:
- name: Harden Runner
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
with:
egress-policy: audit
- name: Checkout Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
submodules: true
- name: Setup Python3
id: pyinstalled
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
with:
python-version: ${{ matrix.python-version }}
# - name: Set up Python${{ matrix.python-version }} with NetCDF4 (conda)
# if: ${{ matrix.os == 'windows-latest' }}
# uses: mamba-org/provision-with-micromamba@main
# with:
# cache-downloads: true
# micromamba-version: 'latest'
# extra-specs: |
# python=${{ matrix.python-version }}
# build
# virtualenv
# - name: Install NetCDF4 (Ubuntu/apt)
# if: ${{ matrix.os == 'ubuntu-latest' }}
# run: |
# sudo apt-get update
# sudo apt-get install libnetcdf-dev
# - name: Install NetCDF4 (macOS/homebrew)
# if: ${{ matrix.os == 'macos-latest' }}
# uses: tecolicom/actions-use-homebrew-tools@v1
# with:
# tools: netcdf
# cache: yes
- name: Install packaging libraries (Ubuntu/macOS)
if: ${{ matrix.os != 'windows-latest' }}
run: ${{ steps.pyinstalled.outputs.python-path }} -m pip install build virtualenv
# - name: Build a binary wheel (Windows)
# if: ${{ matrix.os == 'windows-latest' }}
# run: python -m build --wheel
# - name: Build a binary wheel (Ubuntu/macOS)
# if: ${{ matrix.os != 'windows-latest' }}
# run: ${{ steps.pyinstalled.outputs.python-path }} -m build --wheel
- name: Build a source tarball (Ubuntu)
if: |
(matrix.os == 'ubuntu-latest') && (matrix.python-version == '3.x')
run: ${{ steps.pyinstalled.outputs.python-path }} -m build --sdist
- uses: actions/upload-artifact@v4
with:
path: |
dist/*.tar.gz
# dist/*.whl
if-no-files-found: error
publish-testpypi:
name: Publish Python 🐍 distributions 📦 to TestPyPI
needs: build
runs-on: ubuntu-latest
environment: staging
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
with:
egress-policy: audit
- name: Checkout Repository
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
id: download
with:
name: artifact
path: dist
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
with:
print-hash: true
repository-url: https://test.pypi.org/legacy/
skip-existing: true