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
4 changes: 2 additions & 2 deletions .github/workflows/_publish-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ jobs:
git fetch origin "$BRANCH"
git checkout "$BRANCH"

- uses: dart-lang/setup-dart@v1
- uses: ./.github/actions/setup
with:
sdk: ${{ vars.DART_VERSION }}
dart-version: ${{ vars.DART_VERSION }}

- name: Verify prerequisite packages on pub.dev
if: inputs.tier > 1
Expand Down
59 changes: 59 additions & 0 deletions .github/workflows/finalize-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Finalize Release

on:
workflow_run:
workflows: ["Publish Tier 3"]
types: [completed]

permissions:
contents: write

jobs:
finalize:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Get version from triggering tag
id: version
run: |
git fetch --tags
TAG=$(git tag --points-at ${{ github.event.workflow_run.head_sha }} | grep '^Release/' | head -1)
if [ -z "$TAG" ]; then
echo "::error::No Release tag found at commit ${{ github.event.workflow_run.head_sha }}"
exit 1
fi
VERSION="${TAG#Release/}"
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
echo "Found tag: $TAG, version: $VERSION"

- name: Checkout release branch
run: |
BRANCH="release/${{ steps.version.outputs.VERSION }}"
git fetch origin "$BRANCH"
git checkout "$BRANCH"

- name: Setup Dart
uses: ./.github/actions/setup
with:
dart-version: ${{ vars.DART_VERSION }}

- name: Switch dependencies to local
run: dart run tools/switch_deps.dart local

- name: Commit local dependencies to release branch
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add -A
if git diff --staged --quiet; then
echo "No changes to commit"
else
git commit -m "chore: switch to local dependencies after publish"
git push origin release/${{ steps.version.outputs.VERSION }}
fi
52 changes: 20 additions & 32 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,73 +10,61 @@ permissions:
pull-requests: write

jobs:
validate-and-prepare:
prepare:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.VERSION }}
branch: ${{ steps.branch.outputs.NAME }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Validate branch is main
id: branch
- name: Validate tag is on main
run: |
git fetch origin main
if ! git merge-base --is-ancestor ${{ github.sha }} origin/main; then
echo "::error::Release tag must be created from main branch!"
exit 1
fi
BRANCH=$(git branch -r --contains ${{ github.sha }} | grep -E 'origin/(main|master)' | head -1 | sed 's/.*origin\///')
if [ -z "$BRANCH" ]; then
echo "::error::Tag must be created from main branch"
exit 1
fi
echo "NAME=$BRANCH" >> $GITHUB_OUTPUT

- name: Extract version
- name: Extract version from tag
id: version
run: echo "VERSION=${GITHUB_REF#refs/tags/Release/}" >> $GITHUB_OUTPUT

- name: Checkout main branch
run: git checkout main

- name: Setup Dart
uses: dart-lang/setup-dart@v1
uses: ./.github/actions/setup
with:
sdk: ${{ vars.DART_VERSION }}
dart-version: ${{ vars.DART_VERSION }}

- name: Create release branch
- name: Prepare for publishing (switch to pub.dev deps)
run: dart run tools/prepare_publish.dart ${{ steps.version.outputs.VERSION }}

- name: Create release branch and commit
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git checkout -b release/${{ steps.version.outputs.VERSION }}

- name: Set package versions
run: dart tools/prepare_publish.dart ${{ steps.version.outputs.VERSION }}

- name: Commit and push
run: |
git add -A
git commit -m "chore: prepare release ${{ steps.version.outputs.VERSION }}"
git commit -m "chore: prepare release ${{ steps.version.outputs.VERSION }} with pub.dev dependencies"
git push origin release/${{ steps.version.outputs.VERSION }}

- name: Create PR
- name: Create PR to main
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr create \
--title "Release ${{ steps.version.outputs.VERSION }}" \
--body "## Release ${{ steps.version.outputs.VERSION }}

This PR contains version bumps.
This PR is auto-created from the release tag.

**Do not merge yet!** Publishing happens in tier workflows (tier1 → tier2 → tier3).

After tier3 completes, dependencies will be switched back to local and this PR will be updated.

### Deployment Status
- [ ] Tier 1 (Core)
- [ ] Tier 2 (Reflux, Express, WS, SQLite, MCP)
- [ ] Tier 3 (React)" \
### Publishing Tiers
- Tier 1: dart_logging, dart_node_core (triggered by this workflow)
- Tier 2: reflux, dart_node_express, dart_node_ws, dart_node_better_sqlite3, dart_node_mcp (20 min wait)
- Tier 3: dart_node_react, dart_node_react_native (20 min wait)" \
--base main \
--head release/${{ steps.version.outputs.VERSION }}
1 change: 1 addition & 0 deletions .github/workflows/publish-tier1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ jobs:
with:
tier: 1
packages: "dart_logging dart_node_core"
environment: pub.dev-tier1
secrets: inherit
1 change: 0 additions & 1 deletion packages/dart_node_core/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: dart_node_core
description: Core JS interop utilities for dart_node packages
version: 0.9.0-beta
repository: https://github.com/MelbourneDeveloper/dart_node
publish_to: none

environment:
sdk: ^3.10.0
Expand Down
1 change: 0 additions & 1 deletion packages/dart_node_express/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: dart_node_express
description: Express.js bindings for Dart
version: 0.9.0-beta
repository: https://github.com/MelbourneDeveloper/dart_node
publish_to: none

environment:
sdk: ^3.10.0
Expand Down
1 change: 0 additions & 1 deletion packages/dart_node_react/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: dart_node_react
description: React bindings for Dart
version: 0.9.0-beta
repository: https://github.com/MelbourneDeveloper/dart_node
publish_to: none

environment:
sdk: ^3.10.0
Expand Down
1 change: 0 additions & 1 deletion packages/dart_node_react_native/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: dart_node_react_native
description: React Native bindings for Dart
version: 0.9.0-beta
repository: https://github.com/MelbourneDeveloper/dart_node
publish_to: none

environment:
sdk: ^3.10.0
Expand Down
1 change: 0 additions & 1 deletion packages/dart_node_ws/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: dart_node_ws
description: WebSocket bindings for Dart on Node.js
version: 0.9.0-beta
repository: https://github.com/MelbourneDeveloper/dart_node
publish_to: none

environment:
sdk: ^3.10.0
Expand Down
1 change: 0 additions & 1 deletion packages/reflux/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: reflux
description: Predictable state container for Dart apps - inspired by Redux patterns
version: 0.9.0-beta
repository: https://github.com/MelbourneDeveloper/dart_node
publish_to: none

environment:
sdk: ^3.10.0
Expand Down