diff --git a/.github/workflows/release-prepare.yml b/.github/workflows/release-prepare.yml new file mode 100644 index 00000000000..65fddff8231 --- /dev/null +++ b/.github/workflows/release-prepare.yml @@ -0,0 +1,26 @@ +name: Prepare release +on: + workflow_dispatch: + inputs: + prerelease: + description: 'Version as prerelease' + required: false + default: false + type: boolean + +jobs: + prepare-release: + name: Prepare release + permissions: + contents: write + pull-requests: write + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - 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 diff --git a/.github/workflows/release-publish.yml b/.github/workflows/release-publish.yml new file mode 100644 index 00000000000..347083483ae --- /dev/null +++ b/.github/workflows/release-publish.yml @@ -0,0 +1,22 @@ +name: Publish packages +on: + # Enable to also publish, when pushing a tag + #push: + # tags: + # - '*' + workflow_dispatch: + +jobs: + publish-packages: + name: Publish packages + permissions: + contents: write + id-token: write # Required for authentication using OIDC + runs-on: [ ubuntu-latest ] + steps: + - uses: actions/checkout@v4 + - uses: subosito/flutter-action@v2 + - uses: bluefireteam/melos-action@v3 + with: + publish: true + diff --git a/.github/workflows/release-tag.yml b/.github/workflows/release-tag.yml new file mode 100644 index 00000000000..8ea1d746361 --- /dev/null +++ b/.github/workflows/release-tag.yml @@ -0,0 +1,25 @@ +name: Tag release +on: + push: + branches: [main] + +jobs: + publish-packages: + name: Create tags for release + permissions: + contents: write + runs-on: [ ubuntu-latest ] + if: contains(github.event.head_commit.message, 'chore(release)') + steps: + - uses: actions/checkout@v4 + - 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 }} +