Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
e9b4423
chore: add GitHub workflows for automated npm publishing
thgaskell Jul 9, 2025
b8a79c6
refactor: migrate radfish package from Jest to Vitest
thgaskell Jul 9, 2025
f3e2600
chore: update react-radfish package configuration
thgaskell Jul 9, 2025
9d37e2c
chore: update git tag format to use shorter package names
thgaskell Jul 9, 2025
4580126
feat: add latest tags for packages in publishing workflows
thgaskell Jul 9, 2025
1b04deb
fix: implement proper tag logic for prerelease vs stable releases
thgaskell Jul 9, 2025
fec5d96
chore: add npm tag support for prerelease vs stable releases
thgaskell Jul 9, 2025
d0dabe7
chore: Register workflows on GitHub
thgaskell Jul 14, 2025
6d6c4b1
chore: Remove push trigger
thgaskell Jul 14, 2025
c00912e
fix: checkout current branch instead of hardcoded main
thgaskell Jul 14, 2025
351e071
fix: use broader peer dependency range for radfish
thgaskell Jul 14, 2025
c16412a
chore: update package-lock.json for new peer dependency range
thgaskell Jul 14, 2025
a71434b
fix: update peer dependency to support prereleases
thgaskell Jul 15, 2025
badd730
chore: add --legacy-peer-deps flag to version bump steps
thgaskell Jul 17, 2025
83f8afb
refactor: simplify workflow inputs and logic for version bumping
thgaskell Jul 18, 2025
e3a104d
fix: use jq to parse version from package.json instead of npm output
thgaskell Jul 18, 2025
875ac9f
fix: push to current branch instead of hardcoded main
thgaskell Jul 18, 2025
3871761
chore: reset radfish version to last published version (1.1.2-rc.0)
thgaskell Jul 18, 2025
59fe661
fix: add --legacy-peer-deps to install step in workflows
thgaskell Jul 18, 2025
c89f1f2
chore(release): bump @nmfs-radfish/radfish to 1.1.3-rc.0
github-actions[bot] Jul 18, 2025
39c1264
chore(release): bump @nmfs-radfish/radfish to 1.1.4-rc.0
github-actions[bot] Aug 12, 2025
934d637
fix: add --legacy-peer-deps to test workflow scripts
thgaskell Aug 12, 2025
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
136 changes: 136 additions & 0 deletions .github/workflows/publish-radfish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
name: Publish @nmfs-radfish/radfish to NPM

on:
workflow_dispatch:
inputs:
version_type:
description: 'Version bump type'
required: true
type: choice
options:
- patch # 1.1.2 → 1.1.3
- minor # 1.1.2 → 1.2.0
- major # 1.1.2 → 2.0.0
- prerelease # 1.1.2-rc.1 → 1.1.2-rc.2
- prepatch # 1.1.2 → 1.1.3-rc.1
- preminor # 1.1.2 → 1.2.0-rc.1
- premajor # 1.1.2 → 2.0.0-rc.1

permissions:
contents: write

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Check admin permissions
uses: actions/github-script@v7
with:
script: |
const { data: { permission } } = await github.rest.repos.getCollaboratorPermissionLevel({
owner: context.repo.owner,
repo: context.repo.repo,
username: context.actor
});

if (permission !== 'admin') {
core.setFailed(`User ${context.actor} does not have admin permissions. Current permission: ${permission}`);
}

- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Configure Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: npm install --legacy-peer-deps

- name: Run tests
run: |
set -e
npm test -- --run
working-directory: packages/radfish

- name: Bump version (no git operations)
id: bump-version
run: |
set -e
# Bump version (ignore output)
npm version ${{ inputs.version_type }} --preid=rc --no-git-tag-version --legacy-peer-deps
# Query the updated package.json for clean version
NEW_VERSION=$(jq -r '.version' package.json)
echo "new_version=${NEW_VERSION}" >> $GITHUB_OUTPUT
working-directory: packages/radfish

- name: Publish to NPM
id: npm-publish
run: |
set -e
if [[ "${{ steps.bump-version.outputs.new_version }}" == *"-rc."* ]]; then
npm publish --tag beta
else
npm publish
fi
working-directory: packages/radfish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Commit version bump
if: success()
run: |
set -e
git add packages/radfish/package.json
git commit -m "chore(release): bump @nmfs-radfish/radfish to ${{ steps.bump-version.outputs.new_version }}"

- name: Create and push tags
if: success()
run: |
set -e
git tag "radfish@${{ steps.bump-version.outputs.new_version }}"
git push origin HEAD
if [[ "${{ steps.bump-version.outputs.new_version }}" == *"-rc."* ]]; then
# For prereleases, only tag and push beta
git tag -f "radfish@beta"
git push origin "radfish@${{ steps.bump-version.outputs.new_version }}" "radfish@beta" --force
else
# For regular releases, only tag and push latest
git tag -f "radfish@latest"
git push origin "radfish@${{ steps.bump-version.outputs.new_version }}" "radfish@latest" --force
fi

- name: Create GitHub Release
if: success()
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: "radfish@${{ steps.bump-version.outputs.new_version }}"
release_name: "radfish@${{ steps.bump-version.outputs.new_version }}"
body: |
Release of @nmfs-radfish/radfish version ${{ steps.bump-version.outputs.new_version }}

## Changes
See [commit history](https://github.com/${{ github.repository }}/commits/radfish@${{ steps.bump-version.outputs.new_version }}) for detailed changes.
draft: false
prerelease: ${{ contains(steps.bump-version.outputs.new_version, '-rc.') }}

- name: Rollback version on failure
if: failure() && steps.bump-version.conclusion == 'success'
run: |
set -e
git checkout -- packages/radfish/package.json
echo "Version bump rolled back due to publish failure"
working-directory: .
142 changes: 142 additions & 0 deletions .github/workflows/publish-react-radfish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
name: Publish @nmfs-radfish/react-radfish to NPM

on:
workflow_dispatch:
inputs:
version_type:
description: 'Version bump type'
required: true
type: choice
options:
- patch # 1.1.2 → 1.1.3
- minor # 1.1.2 → 1.2.0
- major # 1.1.2 → 2.0.0
- prerelease # 1.1.2-rc.1 → 1.1.2-rc.2
- prepatch # 1.1.2 → 1.1.3-rc.1
- preminor # 1.1.2 → 1.2.0-rc.1
- premajor # 1.1.2 → 2.0.0-rc.1

permissions:
contents: write

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Check admin permissions
uses: actions/github-script@v7
with:
script: |
const { data: { permission } } = await github.rest.repos.getCollaboratorPermissionLevel({
owner: context.repo.owner,
repo: context.repo.repo,
username: context.actor
});

if (permission !== 'admin') {
core.setFailed(`User ${context.actor} does not have admin permissions. Current permission: ${permission}`);
}

- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Configure Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: npm install --legacy-peer-deps

- name: Run tests
run: |
set -e
npm test -- --run
working-directory: packages/react-radfish

- name: Bump version (no git operations)
id: bump-version
run: |
set -e
# Bump version (ignore output)
npm version ${{ inputs.version_type }} --preid=rc --no-git-tag-version --legacy-peer-deps
# Query the updated package.json for clean version
NEW_VERSION=$(jq -r '.version' package.json)
echo "new_version=${NEW_VERSION}" >> $GITHUB_OUTPUT
working-directory: packages/react-radfish

- name: Build package
run: |
set -e
npm run build
working-directory: packages/react-radfish

- name: Publish to NPM
id: npm-publish
run: |
set -e
if [[ "${{ steps.bump-version.outputs.new_version }}" == *"-rc."* ]]; then
npm publish --tag beta
else
npm publish
fi
working-directory: packages/react-radfish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Commit version bump
if: success()
run: |
set -e
git add packages/react-radfish/package.json
git commit -m "chore(release): bump @nmfs-radfish/react-radfish to ${{ steps.bump-version.outputs.new_version }}"

- name: Create and push tags
if: success()
run: |
set -e
git tag "react-radfish@${{ steps.bump-version.outputs.new_version }}"
git push origin HEAD
if [[ "${{ steps.bump-version.outputs.new_version }}" == *"-rc."* ]]; then
# For prereleases, only tag and push beta
git tag -f "react-radfish@beta"
git push origin "react-radfish@${{ steps.bump-version.outputs.new_version }}" "react-radfish@beta" --force
else
# For regular releases, only tag and push latest
git tag -f "react-radfish@latest"
git push origin "react-radfish@${{ steps.bump-version.outputs.new_version }}" "react-radfish@latest" --force
fi

- name: Create GitHub Release
if: success()
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: "react-radfish@${{ steps.bump-version.outputs.new_version }}"
release_name: "react-radfish@${{ steps.bump-version.outputs.new_version }}"
body: |
Release of @nmfs-radfish/react-radfish version ${{ steps.bump-version.outputs.new_version }}

## Changes
See [commit history](https://github.com/${{ github.repository }}/commits/react-radfish@${{ steps.bump-version.outputs.new_version }}) for detailed changes.
draft: false
prerelease: ${{ contains(steps.bump-version.outputs.new_version, '-rc.') }}

- name: Rollback version on failure
if: failure() && steps.bump-version.conclusion == 'success'
run: |
set -e
git checkout -- packages/react-radfish/package.json
echo "Version bump rolled back due to publish failure"
working-directory: .
4 changes: 2 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ jobs:
ref: ${{ github.event.pull_request.head.sha }}

- name: Install workspace dependencies
run: npm install
run: npm install --legacy-peer-deps
working-directory: .

- name: Install dependencies
run: npm install
run: npm install --legacy-peer-deps
working-directory: templates/react-javascript

- name: Build project
Expand Down
Loading
Loading