Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .github/workflows/publish-PyPI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Publish to PyPI
run-name: Publish Python Package to PyPI for release ${{ github.event.release.tag_name }}

on:
release:
types: [published]
workflow_dispatch:
inputs:
tag_name:
description: 'Git tag to checkout and publish'
required: false
type: string

jobs:
build:
name: Build distribution 📦
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ inputs.tag_name || github.ref }}

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install pypa/build
run: >-
python3 -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/
publish-to-pypi:
name: Publish to PyPI
needs:
- build
runs-on: ubuntu-latest

environment:
name: pypi
url: https://pypi.org/p/pygmt-helper

permissions:
id-token: write

steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ requires = ["setuptools","setuptools-scm"]
build-backend = "setuptools.build_meta"

[project]
name = "pygmt_helper"
version = "22.8.1"
name = "pygmt-helper"
authors = [{name = "ucgmsim"}]
description = "PyGMT helper package"
readme = "ReadMe.md"
requires-python = ">=3.11,<3.14"
dynamic = ["dependencies"]
dynamic = ["version", "dependencies"]

[tool.setuptools_scm]

[tool.setuptools.dynamic]
dependencies = {file = ["requirements.txt"]}
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pyproj
xarray
scipy
shapely
qcore @ git+https://github.com/ucgmsim/qcore.git
qcore-utils @ git+https://github.com/ucgmsim/qcore.git
pytest
pytest-cov
pooch
Expand Down