Skip to content

Commit 09eef92

Browse files
committed
Add the nuverse publish workflow
1 parent d1b6199 commit 09eef92

4 files changed

Lines changed: 102 additions & 0 deletions

File tree

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Publishes the `nuverse` distribution to PyPI on a tag push like `nuverse@0.1.0`.
2+
# Manual "Run workflow" dispatch builds only, unless you tick `publish`.
3+
#
4+
# nuverse is the extensions package: the apps (`+`) and snippets (`/`) a space
5+
# offers out of the box. nuspace finds it through the `nuspace.extensions`
6+
# entry point and hard-depends on it. It carries python source only, no node
7+
# toolchain needed.
8+
#
9+
# `nuspace` tags own release semantics for the repo (GitHub Release). This tag
10+
# does not cut a release, same as `nuspace-ui`.
11+
#
12+
# Setup once (PyPI trusted publisher / OIDC, no secrets):
13+
# pypi.org -> account -> Publishing -> Add pending publisher
14+
# PyPI project name: nuverse
15+
# Owner: nustackdev
16+
# Repository name: nuspace
17+
# Workflow name: publish-nuverse.yml
18+
# Environment name: (leave blank)
19+
#
20+
# Ordering on a coordinated release: nuverse depends on nuspace and nuspace on
21+
# nuverse, so push `nuverse@` first, then `nuspace@`. pip resolves the cycle
22+
# once both are on the index.
23+
#
24+
# Release flow:
25+
# 1. Bump `version` in `pkgs/nuverse/pyproject.toml`.
26+
# 2. Commit and push to main.
27+
# 3. `git tag nuverse@X.Y.Z && git push origin nuverse@X.Y.Z`.
28+
name: Publish nuverse to PyPI
29+
30+
on:
31+
push:
32+
tags: ["nuverse@*"]
33+
workflow_dispatch:
34+
inputs:
35+
publish:
36+
description: "Publish to PyPI (otherwise build only)"
37+
type: boolean
38+
default: false
39+
40+
permissions:
41+
contents: read
42+
id-token: write # PyPI trusted publishing (OIDC)
43+
44+
concurrency:
45+
group: publish-nuverse
46+
cancel-in-progress: false
47+
48+
env:
49+
PKG_DIR: pkgs/nuverse
50+
51+
jobs:
52+
publish:
53+
runs-on: ubuntu-latest
54+
timeout-minutes: 10
55+
steps:
56+
- uses: actions/checkout@v4
57+
58+
- uses: actions/setup-python@v5
59+
with:
60+
python-version: "3.12"
61+
62+
- name: install uv
63+
uses: astral-sh/setup-uv@v5
64+
65+
- name: verify tag matches pyproject.toml version
66+
if: startsWith(github.ref, 'refs/tags/nuverse@')
67+
working-directory: ${{ env.PKG_DIR }}
68+
run: |
69+
TAG_VERSION="${GITHUB_REF#refs/tags/nuverse@}"
70+
PKG_VERSION=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])")
71+
if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then
72+
echo "tag nuverse@$TAG_VERSION does not match pyproject.toml version $PKG_VERSION"
73+
exit 1
74+
fi
75+
76+
# The workspace source for nuspace is dev-only; a hatchling build is
77+
# metadata-only, so the wheel carries the plain PyPI requirement.
78+
- name: build distribution
79+
working-directory: ${{ env.PKG_DIR }}
80+
run: uv build --out-dir dist
81+
82+
- name: publish nuverse
83+
if: >-
84+
startsWith(github.ref, 'refs/tags/nuverse@') || inputs.publish
85+
uses: pypa/gh-action-pypi-publish@release/v1
86+
with:
87+
packages-dir: pkgs/nuverse/dist
88+
skip-existing: true

‎CHANGELOG.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@
44

55
- **nuspace** (the runtime, the `nuspace` command) — 0.3.1
66
- **nuspace-ui** (the compiled web bundle) — 0.3.0
7+
- **nuverse** (the apps and snippets a space ships with) — 0.1.0
78

89
Below is the changelog for **nuspace** - the full commit stream. Newest first.
910
The `nuspace-ui` wheel is the same source tree's vite output and is not tracked
1011
separately here.
1112

1213
## Unreleased
1314

15+
- Publish nuverse on its own tag so the extensions ship separately
1416
- Pick any registered snippet from the / menu
1517
- An open page runs every cell as soon as you land on it, even after a restart
1618
- Ship apps and snippets as nuverse, a separate package found on install

‎pkgs/nuverse/README.md‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# nuverse
2+
3+
The extensions a [nuspace](https://github.com/nustackdev/nuspace) space offers out of the box: the apps `+` makes and the snippets `/` inserts.
4+
5+
nuspace finds it on install through the `nuspace.extensions` entry point. You don't import it yourself.
6+
7+
```
8+
pip install nuspace
9+
```
10+
11+
Early. It tracks nuspace's unreleased v4 and needs it to be useful.

‎pkgs/nuverse/pyproject.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ build-backend = "hatchling.build"
66
name = "nuverse"
77
version = "0.1.0"
88
description = "nuspace extensions: the apps and snippets a space offers out of the box."
9+
readme = "README.md"
910
license = "AGPL-3.0-or-later"
1011
authors = [{ name = "Gor Arakelyan", email = "gorarkln@gmail.com" }]
1112
requires-python = ">=3.10"

0 commit comments

Comments
 (0)