Skip to content
Closed
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
50 changes: 50 additions & 0 deletions .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Bump Version Tag

on:
push:
branches: [main]

jobs:
bump-version:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0

- uses: actions/setup-node@v6
with:
node-version: '24'

- name: Get latest version tag
id: get_version
run: |
git fetch --tags
LATEST_TAG=$(git tag -l "v*" | sort -V | tail -n 1)
if [ -z "$LATEST_TAG" ]; then
echo "latest=v0.0.0" >> $GITHUB_OUTPUT
else
echo "latest=$LATEST_TAG" >> $GITHUB_OUTPUT
fi

- name: Bump prerelease version
id: bump_version
run: |
LATEST_VERSION="${{ steps.get_version.outputs.latest }}"
VERSION_NUMBER="${LATEST_VERSION#v}"

echo "$VERSION_NUMBER" > VERSION_TEMP
npm version --no-git-tag-version $VERSION_NUMBER
npm version --no-git-tag-version prerelease --preid=dev

NEW_VERSION=$(node -p "require('./package.json').version")
echo "new_version=v$NEW_VERSION" >> $GITHUB_OUTPUT

- name: Create and push tag
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag ${{ steps.bump_version.outputs.new_version }}
git push origin ${{ steps.bump_version.outputs.new_version }}
43 changes: 43 additions & 0 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Publish to NPM

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+-dev.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+'

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v5

- uses: actions/setup-node@v6
with:
node-version: '24'
registry-url: 'https://registry.npmjs.org'

- name: Extract version from tag
id: get_version
run: |
VERSION="${GITHUB_REF#refs/tags/v}"
echo "version=$VERSION" >> $GITHUB_OUTPUT
if [[ "$VERSION" == *"-dev."* ]]; then
echo "tag=dev" >> $GITHUB_OUTPUT
else
echo "tag=latest" >> $GITHUB_OUTPUT
fi

- name: Update package.json version
run: npm version --no-git-tag-version ${{ steps.get_version.outputs.version }}

- run: npm ci
- run: npm run postinstall

- name: Build with remote save enabled
run: VITE_REMOTE_SERVER_URL= VITE_ENABLE_REMOTE_SAVE=true npm run build

- run: npm publish --provenance --access public --tag ${{ steps.get_version.outputs.tag }}
30 changes: 28 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Before you begin, make sure your environment matches the following versions:

- **Node.js**: >= 18.20.0 (20.x LTS recommended)
- **Node.js**: >= 18.20.0 (20.x LTS recommended)
- **npm**: >= 9.x (npm 10+ works with Node 20)

Check your versions:
Expand All @@ -22,7 +22,6 @@ For reproducible installs, use:
npm ci
```


---

## Dependencies
Expand Down Expand Up @@ -97,6 +96,33 @@ npm run test:e2e:dev -- -- --spec ./tests/specs/remote-manifest.e2e.ts

---

## Versioning

Merging to `main` automatically publishes dev versions to NPM:

1. Merge creates a prerelease tag (v4.4.0-dev.1, v4.4.0-dev.2, etc.)
2. Tag triggers automatic NPM publish with `@dev` dist-tag

Users install stable versions by default:

```bash
npm install volview # Gets latest stable (e.g., 4.4.0)
npm install volview@dev # Gets latest dev (e.g., 4.4.0-dev.5)
```

For stable releases, manually create a tag:

```bash
git tag v4.5.0 # or v5.0.0
git push origin v4.5.0
```

### Update demo site

To update https://volview.kitware.app/, merge to the `stable` branch.

---

## Developing with VTK.js

Follow these steps to develop against a custom development branch of VTK.js:
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
"name": "volview",
"version": "4.4.0",
"type": "module",
"files": [
"dist",
"src"
],
"scripts": {
"dev": "cross-env VITE_SHOW_SAMPLE_DATA=true vite",
"preview": "vite preview",
Expand Down
Loading