Skip to content

Commit

Permalink
Merge from master branch
Browse files Browse the repository at this point in the history
  • Loading branch information
CatHood0 committed Nov 28, 2024
2 parents c4ccec7 + b8554e3 commit 8304a19
Show file tree
Hide file tree
Showing 351 changed files with 9,802 additions and 20,301 deletions.
46 changes: 16 additions & 30 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,36 @@
<!--
Thank you for contributing.
Provide a description of your changes below and a general summary in the title.
Consider reading the Contributor Guide: https://github.com/singerdmx/flutter-quill/blob/master/CONTRIBUTING.md.
The changes of `CHANGELOG.md` and package version in `pubspec.yaml` are automated.
Briefly describe your changes and summarize in the title.
Contributor Guide: https://github.com/singerdmx/flutter-quill/blob/master/CONTRIBUTING.md
Package versioning is automated.
Add updates to `Unreleased` in `CHANGELOG.md` following [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) format.
-->

## Description

*Replace this paragraph with a description of what this PR is doing. If you're modifying existing behavior, describe the existing behavior, how this PR is changing it, and what motivated the change.*
*Describe what this PR does. If modifying behavior, explain the current and new behavior, along with the motivation.*

## Related Issues

<!--
Replace this paragraph with a list of issues related to this PR from the [issue database](https://github.com/singerdmx/flutter-quill/issues). Indicate, which of these issues are resolved or fixed by this PR.
-->

<!-- *e.g.* -->
*e.g.*
- *Fix #123*
- *Related #456*
-->

## Type of Change

<!---
Put an x in all the boxes that apply:
- [x] **Example:**
<!---
Check the boxes that apply with x and leave the others empty. For example:
- [ ] ✨ **New feature:** Adds new functionality without breaking existing features.
- [x] 🛠️ **Bug fix:** Resolves an issue without changing current behavior.
-->

- [ ]**New feature:** Adds new functionality without breaking existing features.
- [ ]**Feature:** New functionality without breaking existing features.
- [ ] 🛠️ **Bug fix:** Resolves an issue without altering current behavior.
- [ ] 🧹 **Code refactor:** Code restructuring that does not affect behavior.
- [ ]**Breaking change:** Alters existing functionality and requires updates.
- [ ] 🧪 **Tests:** Adds new tests or modifies existing tests.
- [ ] 🧹 **Refactor:** Code reorganization, no behavior change.
- [ ]**Breaking:** Alters existing functionality and requires updates.
- [ ] 🧪 **Tests:** New or modified tests
- [ ] 📝 **Documentation:** Updates or additions to documentation.
- [ ] 🗑️ **Chore:** Routine tasks, or maintenance.
- [ ]**Build configuration change:** Changes to build or deploy processes.

## Suggestions

<!-- Optional -->
- [ ]**Build configuration change:** Build/configuration changes.
19 changes: 19 additions & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: 📝 Changelog File Check

# This workflow only validates if the CHANGELOG.md file was updated and doesn't validate the format.

on:
pull_request:
types: [assigned, opened, synchronize, reopened, labeled, unlabeled]
branches:
- master

jobs:
changelog:
name: 🔍 Verify Changelog Modification
runs-on: ubuntu-latest
steps:
- name: ✅ Check if CHANGELOG.md was modified
uses: tarides/changelog-check-action@v2
with:
changelog: CHANGELOG.md
11 changes: 10 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
name: 🧪 Run Tests

# TODO: Split the tests into tests.yml and quality checks into checks.yml once start using https://pub.dev/packages/melos

on:
push:
branches: [master, dev]
Expand Down Expand Up @@ -49,4 +51,11 @@ jobs:
run: flutter test

- name: 🔍 Check the translations
run: dart ./scripts/ensure_translations_correct.dart
run: dart ./scripts/translations_check.dart

- name: 📥 Install cider
run: dart pub global activate cider

# TODO: Need a more strict way to validate the format that uses https://keepachangelog.com/en/1.1.0/
- name: 🔍 Validate CHANGELOG.md format
run: $HOME/.pub-cache/bin/cider list CHANGELOG.md
66 changes: 20 additions & 46 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,23 @@
name: 🚀 Publish to pub.dev

# Note: This workflow only publishes flutter_quill package, the flutter_quill_extensions
# need to be manually published.

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'
- 'v[0-9]+.[0-9]+.[0-9]+*'

jobs:
publish:
name: Publish the packages
name: Publish the flutter_quill package
permissions:
id-token: write
# Give the default GITHUB_TOKEN write permission to commit and push the changed files to the repository.
# Also required for uploading files to the Release assets
contents: write
id-token: write # Required for authentication using OIDC to publish to pub.dev
contents: write # Required for creating a GitHub release and uploading the LICENSE file
runs-on: ubuntu-latest
steps:
- name: 📦 Checkout repository
uses: actions/checkout@v4
# Needed for commit and push changes
with:
# TODO: Try to not hardcode the branch name
ref: master
fetch-depth: 0 # To get all tags

- name: 📄 Upload LICENSE file to release assets
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: LICENSE

- name: 🛠️ Set up Flutter
uses: subosito/flutter-action@v2
Expand All @@ -50,54 +40,38 @@ jobs:
# - name: Update the authorization requests to "https://pub.dev" to use the environment variable "PUB_TOKEN".
# run: dart pub token add https://pub.dev --env-var PUB_TOKEN

# Before publishing the new packages, update the version for all the packages first

# Extract version from the tag (handles the 'v' prefix)
- name: 🏷️ Extract version from tag as pubspec.yaml version
id: extract_version
run: |
version=$(echo ${GITHUB_REF} | sed 's/^refs\/tags\/v\(.*\)$/\1/')
echo "VERSION=${version}" >> $GITHUB_OUTPUT
- name: Validate extracted version format (should be pubspec.yaml valid version)
- name: 🔍 Validate extracted version format (should be pubspec.yaml valid version)
run: |
version=${{ steps.extract_version.outputs.VERSION }}
if [[ ! $version =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?(\+[0-9A-Za-z.-]+)?$ ]]; then
echo "❌ Invalid version format: $version. The version must be a valid pubspec.yaml version"
exit 1
fi
- name: 🏷️ Extract release tag
id: release_tag
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT

- name: 📑 Fetch release notes from Github API and create a required file by the next step
run: dart ./scripts/create_version_content_from_github_release.dart "${{ github.repository }}" "${{ steps.release_tag.outputs.tag }}"

- name: 📝 Update version and CHANGELOG for all the packages
run: dart ./scripts/update_package_version.dart ${{ steps.extract_version.outputs.VERSION }}

- name: 💾 Commit updated version and CHANGELOG
id: auto-commit-action
uses: stefanzweifel/git-auto-commit-action@v5
- name: ✂️ Extract Release Notes from CHANGELOG.md
id: extract-release-notes
uses: ffurrer2/extract-release-notes@v2
with:
commit_message: "chore(version): update to version ${{ steps.extract_version.outputs.VERSION }}"
changelog_file: CHANGELOG.md
release_notes_file: RELEASE_NOTES.md

- name: 🔍 Verify changes made by the script
if: steps.auto-commit-action.outputs.changes_detected == 'true'
run: echo "✅ Changes have been committed."
- name: 🚀 Create a GitHub Release
uses: ncipollo/release-action@v1
with:
artifacts: "LICENSE"
bodyFile: "RELEASE_NOTES.md"
tag: ${{ github.ref_name }}
prerelease: ${{ contains(github.ref_name, '-') }}

- name: 🔄 Check if package is ready for publishing
run: flutter pub publish --dry-run

- name: 📤 Publish flutter_quill
run: flutter pub publish --force

- name: 📤 Publish flutter_quill_extensions
run: flutter pub publish --force
working-directory: ./flutter_quill_extensions/

- name: 📤 Publish flutter_quill_test
run: flutter pub publish --force
working-directory: ./flutter_quill_test/

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,5 @@ example/ios/Podfile.lock
!**/ios/**/default.mode2v3
!**/ios/**/default.pbxuser
!**/ios/**/default.perspectivev3
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspec-lock.
pubspec.lock
Loading

0 comments on commit 8304a19

Please sign in to comment.