Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
31 changes: 26 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ name: Publish release
on:
release:
types: [published]
workflow_dispatch:
inputs:
tag:
description: Existing release tag whose Python package should be republished
required: true
type: string

permissions:
contents: read
Expand All @@ -14,15 +20,20 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v7
with:
ref: ${{ github.event.release.tag_name || inputs.tag }}
- name: Check target versions
run: python .github/scripts/check-version.py "${{ github.event.release.tag_name }}"
run: python .github/scripts/check-version.py "${{ github.event.release.tag_name || inputs.tag }}"

make-sdist:
name: Make Python sdist
if: github.event_name == 'release' || github.event_name == 'workflow_dispatch'
needs: check-version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
ref: ${{ github.event.release.tag_name || inputs.tag }}
- uses: astral-sh/setup-uv@v10.0.1
- name: Build sdist
run: uv build --directory targets/ptfkit-py --sdist
Expand All @@ -33,6 +44,7 @@ jobs:

build-wheels:
name: Build Python wheels on ${{ matrix.os }}
if: github.event_name == 'release' || github.event_name == 'workflow_dispatch'
needs: check-version
runs-on: ${{ matrix.runs-on }}
strategy:
Expand All @@ -50,20 +62,23 @@ jobs:
runs-on: macos-latest
steps:
- uses: actions/checkout@v7
with:
ref: ${{ github.event.release.tag_name || inputs.tag }}
- name: Build wheels
uses: pypa/cibuildwheel@v4.2.0
with:
package-dir: targets/ptfkit-py/dist
package-dir: targets/ptfkit-py
output-dir: targets/ptfkit-py/dist/wheelhouse
env:
CIBW_BUILD_FRONTEND: uv
- uses: actions/upload-artifact@v7
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: targets/ptfkit-py/wheelhouse/*.whl
path: targets/ptfkit-py/dist/wheelhouse/*.whl

publish-pypi:
name: Publish to PyPI
if: github.event_name == 'release' || github.event_name == 'workflow_dispatch'
needs: [make-sdist, build-wheels]
runs-on: ubuntu-latest
environment:
Expand All @@ -84,6 +99,7 @@ jobs:

publish-crates:
name: Publish to crates.io
if: github.event_name == 'release'
needs: check-version
runs-on: ubuntu-latest
environment:
Expand All @@ -93,6 +109,8 @@ jobs:
id-token: write
steps:
- uses: actions/checkout@v7
with:
ref: ${{ github.event.release.tag_name || inputs.tag }}
- name: Authenticate to crates.io with trusted publishing
id: auth
uses: rust-lang/crates-io-auth-action@v1
Expand All @@ -107,6 +125,7 @@ jobs:

publish-native:
name: Publish native source archive
if: github.event_name == 'release'
needs: check-version
runs-on: ubuntu-latest
permissions:
Expand All @@ -115,9 +134,11 @@ jobs:
attestations: write
steps:
- uses: actions/checkout@v7
with:
ref: ${{ github.event.release.tag_name || inputs.tag }}
- name: Create native archive
env:
TAG: ${{ github.event.release.tag_name }}
TAG: ${{ github.event.release.tag_name || inputs.tag }}
run: |
version="${TAG#v}"
archive="ptfkit-native-${version}.tar.gz"
Expand All @@ -133,4 +154,4 @@ jobs:
- name: Upload native archive to GitHub Release
env:
GH_TOKEN: ${{ github.token }}
run: gh release upload "${{ github.event.release.tag_name }}" "$archive" "$archive.sha256" --clobber
run: gh release upload "${{ github.event.release.tag_name || inputs.tag }}" "$archive" "$archive.sha256" --clobber
2 changes: 1 addition & 1 deletion targets/ptfkit-native/cmake/ptfkitVersion.cmake
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# @generated by ptfkit-codegen; do not edit.
set(PTFKIT_VERSION "0.1.0")
set(PTFKIT_VERSION "0.2.0")
2 changes: 1 addition & 1 deletion targets/ptfkit-py/src/ptfkit/_version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# @generated by ptfkit-codegen; do not edit.
__version__ = '0.1.0'
__version__ = '0.2.0'
2 changes: 1 addition & 1 deletion targets/ptfkit-rs/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion targets/ptfkit-rs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ptfkit"
version = "0.1.0"
version = "0.2.0"
edition = "2024"
description = "Pedotransfer functions for estimating soil hydraulic properties"
license = "MIT"
Expand Down