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
86 changes: 86 additions & 0 deletions .github/workflows/dev-release-testpypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Dev Release to TestPyPI

on:
push:
branches: [dev]
workflow_dispatch:

concurrency:
group: dev-release-testpypi
cancel-in-progress: false

jobs:
dev-release-testpypi:
name: Create dev release and publish to TestPyPI
runs-on: ubuntu-latest

environment:
name: testpypi
url: https://test.pypi.org/p/epics/

permissions:
contents: write
id-token: write

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"

- name: Read package version
id: version
run: |
VERSION=$(python - <<'PY'
import tomllib
with open("pyproject.toml", "rb") as f:
data = tomllib.load(f)
print(data["project"]["version"])
PY
)
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "tag=v$VERSION" >> "$GITHUB_OUTPUT"

- name: Check if release already exists
id: release_exists
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ steps.version.outputs.tag }}
run: |
if gh release view "$TAG" >/dev/null 2>&1; then
echo "exists=true" >> "$GITHUB_OUTPUT"
echo "Release $TAG already exists. Skipping publish."
else
echo "exists=false" >> "$GITHUB_OUTPUT"
fi

- name: Create GitHub prerelease
if: steps.release_exists.outputs.exists == 'false'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ steps.version.outputs.tag }}
VERSION: ${{ steps.version.outputs.version }}
run: |
gh release create "$TAG" \
--target "$GITHUB_SHA" \
--prerelease \
--title "$TAG" \
--notes "Automated dev release for version $VERSION from dev branch."

- name: Install build dependencies
if: steps.release_exists.outputs.exists == 'false'
run: python -m pip install --upgrade build

- name: Build wheel and source distribution
if: steps.release_exists.outputs.exists == 'false'
run: python -m build

- name: Publish to TestPyPI
if: steps.release_exists.outputs.exists == 'false'
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# PyEPICS

<a href="https://doi.org/10.5281/zenodo.18648203"><img src="https://zenodo.org/badge/DOI/10.5281/zenodo.18648203.svg" alt="DOI"></a>
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.18648203.svg)](https://doi.org/10.5281/zenodo.18648203)
[![CI](https://github.com/melekderman/PyEPICS/actions/workflows/test.yml/badge.svg)](https://github.com/melekderman/PyEPICS/actions/workflows/test.yml)
[![Python 3.11+](https://img.shields.io/badge/python-3.11%2B-blue.svg)](https://www.python.org/downloads/)
[![License: BSD-3](https://img.shields.io/badge/license-BSD--3--Clause-green.svg)](LICENSE)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "epics"
version = "1.0.0"
version = "1.0.1.dev1"
description = "Python library for reading and converting EPICS (Electron Photon Interaction Cross Sections) nuclear data"
readme = "README.md"
license = {text = "BSD-3-Clause"}
Expand Down
Loading