diff --git a/README.md b/README.md index 26482ed..632cbe0 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/examples/01-workflow-dispatch/release-prepare.yml b/examples/01-workflow-dispatch/release-prepare.yml index 6c8f203..6cc8cdc 100644 --- a/examples/01-workflow-dispatch/release-prepare.yml +++ b/examples/01-workflow-dispatch/release-prepare.yml @@ -17,6 +17,8 @@ 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: @@ -24,5 +26,3 @@ jobs: run-versioning-prerelease: ${{ inputs.prerelease == true }} publish-dry-run: true create-pr: true - git-email: contact@blue-fire.xyz - git-name: Melos Action diff --git a/examples/01-workflow-dispatch/release-publish.yml b/examples/01-workflow-dispatch/release-publish.yml index 2fcf24c..1a45684 100644 --- a/examples/01-workflow-dispatch/release-publish.yml +++ b/examples/01-workflow-dispatch/release-publish.yml @@ -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: contact@blue-fire.xyz - git-name: Melos Action diff --git a/examples/01-workflow-dispatch/release-tag.yml b/examples/01-workflow-dispatch/release-tag.yml index abb1a16..bb1e5df 100644 --- a/examples/01-workflow-dispatch/release-tag.yml +++ b/examples/01-workflow-dispatch/release-tag.yml @@ -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 }} + diff --git a/examples/02-release-on-pr/release-prepare.yml b/examples/02-release-on-pr/release-prepare.yml index d91f72e..4d788bb 100644 --- a/examples/02-release-on-pr/release-prepare.yml +++ b/examples/02-release-on-pr/release-prepare.yml @@ -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: contact@blue-fire.xyz - git-name: Melos Action diff --git a/examples/02-release-on-pr/release-publish.yml b/examples/02-release-on-pr/release-publish.yml index 2fcf24c..1a45684 100644 --- a/examples/02-release-on-pr/release-publish.yml +++ b/examples/02-release-on-pr/release-publish.yml @@ -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: contact@blue-fire.xyz - git-name: Melos Action diff --git a/examples/02-release-on-pr/release-tag.yml b/examples/02-release-on-pr/release-tag.yml index abb1a16..bb1e5df 100644 --- a/examples/02-release-on-pr/release-tag.yml +++ b/examples/02-release-on-pr/release-tag.yml @@ -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 }} + diff --git a/examples/03-check-only/release-verify.yml b/examples/03-check-only/release-verify.yml index 84b667f..645c88f 100644 --- a/examples/03-check-only/release-verify.yml +++ b/examples/03-check-only/release-verify.yml @@ -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: contact@blue-fire.xyz - git-name: Melos Action