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
45 changes: 45 additions & 0 deletions .github/workflows/release-prepare.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Prepare Release

on:
workflow_dispatch:
inputs:
prerelease:
description: 'Version as prerelease'
required: false
default: false
type: boolean
graduate:
description: 'Graduate prereleases to stable'
required: false
default: false
type: boolean

permissions:
contents: write
pull-requests: write

jobs:
prepare-release:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: "3.27.4"
cache: true

- name: Version packages
uses: bluefireteam/melos-action@v3
with:
run-versioning: ${{ inputs.prerelease == false }}
run-versioning-prerelease: ${{ inputs.prerelease == true }}
run-versioning-graduate: ${{ inputs.graduate == true }}
create-pr: true
pr-title: 'chore(release): publish packages'
token: ${{ secrets.GITHUB_TOKEN }}
35 changes: 35 additions & 0 deletions .github/workflows/release-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Publish Packages

on:
workflow_dispatch:

concurrency:
group: release-publish-${{ github.ref }}
cancel-in-progress: false

permissions:
contents: write
id-token: write

jobs:
publish-package:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: "3.27.4"
cache: true

- name: Publish to pub.dev and create GitHub Release
uses: bluefireteam/melos-action@v3
with:
publish: true
create-release: true
token: ${{ secrets.GITHUB_TOKEN }}
45 changes: 45 additions & 0 deletions .github/workflows/release-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Create Release Tags

on:
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false

permissions:
contents: write
actions: write

jobs:
create-tags:
if: ${{ contains(github.event.head_commit.message, 'chore(release):') }}
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: "3.27.4"
cache: true

- name: Tag packages
uses: bluefireteam/melos-action@v3
with:
tag: true
token: ${{ secrets.GITHUB_TOKEN }}

- name: Trigger publish workflows
run: |
melos exec -c 1 --no-published --no-private --order-dependents -- \
gh workflow run release-publish.yml \
--ref \$MELOS_PACKAGE_NAME-v\$MELOS_PACKAGE_VERSION
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26 changes: 13 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,19 +133,19 @@ Once your PR is open:


## 7. Release Process (For Maintainers)
This project uses Melos to handle versioning and publishing. Once changes in main are ready to release:

1. Pull the latest main branch locally.
2. For the changed packages, update the version in the `pubspec.yaml` file. The version should follow the [Semantic Versioning](https://semver.org/) guidelines.
3. Update the `CHANGELOG.md` file with the new version and a list of changes. The changes should be grouped by package and follow the format of the previous entries.
4. Dry run publish:
```bash
melos publish
```
5. If everything looks good, publish:
```bash
melos publish --no-dry-run
```
This project uses Melos together with GitHub Actions to handle versioning and publishing. Once changes in main are ready to release:

1. Run the [`Prepare Release`](../../actions/workflows/release-prepare.yml) workflow via `workflow_dispatch` (`gh workflow run release-prepare.yml`). This bumps versions and updates `CHANGELOG.md` for all changed packages, based on their conventional commit history, and opens a `chore(release): publish packages` pull request.
- Use the `prerelease` input to cut a prerelease instead of a stable version.
- Use the `graduate` input to graduate existing prereleases to stable.
2. Review the generated pull request (versions, changelog entries) and merge it into main.
3. Merging triggers [`Create Release Tags`](../../actions/workflows/release-tag.yml), which tags each changed package and triggers [`Publish Packages`](../../actions/workflows/release-publish.yml) for it.
4. `Publish Packages` runs `melos publish` for that package (via pub.dev trusted publishing) and creates the matching GitHub release. No local publish steps or stored pub.dev credentials are needed.

You can still dry-run a version bump locally before triggering the workflow:
```bash
melos version --no-changelog
```

## 8. Contributing Documentation
If you’d like to improve or add documentation:
Expand Down