Skip to content

Commit

Permalink
docs: Add to example how to automatically release all packages (#16)
Browse files Browse the repository at this point in the history
Fixes: #19
  • Loading branch information
spydon authored Oct 7, 2024
1 parent c7dcb92 commit be64ed7
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 17 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,10 @@ merged you have a few different options:
1. **[Version and release on workflow dispatch:](./examples/01-workflow-dispatch)**
Create three actions: one which versions and dry-run publishes your packages
and then creates a release preparation PR when this workflow is triggered.
And a second action that creates a tag when the PR is merged.
In a third action a manual dispatch workflow is created to publish the created
tag to pub.dev.
And a second action that creates a tag when the PR is merged and starts the
release workflow.
In the third action a dispatch workflow is created to publish the created
tags to pub.dev.
2. **[Version and release on each PR:](./examples/02-release-on-pr)**
Create three actions: one which versions and dry-run publishes your packages
and then creates a release preparation PR every time a PR from a contributor
Expand Down
4 changes: 2 additions & 2 deletions examples/01-workflow-dispatch/release-prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: subosito/flutter-action@v2
- uses: bluefireteam/melos-action@v3
with:
run-versioning: ${{ inputs.prerelease == false }}
run-versioning-prerelease: ${{ inputs.prerelease == true }}
publish-dry-run: true
create-pr: true
git-email: [email protected]
git-name: Melos Action
4 changes: 2 additions & 2 deletions examples/01-workflow-dispatch/release-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:
runs-on: [ ubuntu-latest ]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: subosito/flutter-action@v2
- uses: bluefireteam/melos-action@v3
with:
publish: true
git-email: [email protected]
git-name: Melos Action
14 changes: 12 additions & 2 deletions examples/01-workflow-dispatch/release-tag.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
name: Tag release
name: Tag and start release
on:
push:
branches: [main]

jobs:
publish-packages:
name: Create tag for a release
name: Create tags for release
permissions:
actions: write
contents: write
runs-on: [ ubuntu-latest ]
if: contains(github.event.head_commit.message, 'chore(release)')
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: subosito/flutter-action@v2
- uses: bluefireteam/melos-action@v3
with:
tag: true
- run: |
melos exec -c1 --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 }}
4 changes: 2 additions & 2 deletions examples/02-release-on-pr/release-prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ jobs:
if: "!contains(github.event.head_commit.message, 'chore(release)')"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: subosito/flutter-action@v2
- uses: bluefireteam/melos-action@v3
with:
run-versioning: true
publish-dry-run: true
create-pr: true
git-email: [email protected]
git-name: Melos Action
4 changes: 2 additions & 2 deletions examples/02-release-on-pr/release-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:
runs-on: [ ubuntu-latest ]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: subosito/flutter-action@v2
- uses: bluefireteam/melos-action@v3
with:
publish: true
git-email: [email protected]
git-name: Melos Action
14 changes: 12 additions & 2 deletions examples/02-release-on-pr/release-tag.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
name: Tag release
name: Tag and start release
on:
push:
branches: [main]

jobs:
publish-packages:
name: Create tag for a release
name: Create tags for release
permissions:
actions: write
contents: write
runs-on: [ ubuntu-latest ]
if: contains(github.event.head_commit.message, 'chore(release)')
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: subosito/flutter-action@v2
- uses: bluefireteam/melos-action@v3
with:
tag: true
- run: |
melos exec -c1 --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 }}
4 changes: 2 additions & 2 deletions examples/03-check-only/release-verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
runs-on: [ ubuntu-latest ]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: subosito/flutter-action@v2
- uses: bluefireteam/melos-action@v3
with:
run-versioning: true
publish-dry-run: true
git-email: [email protected]
git-name: Melos Action

0 comments on commit be64ed7

Please sign in to comment.