dartlangeditorflutterflutter-appsflutter-examplesflutter-packageflutter-widgetquillquill-deltaquilljsreactquillrich-textrich-text-editorwysiwygwysiwyg-editor
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
101 lines
3.6 KiB
101 lines
3.6 KiB
name: Publish to pub.dev |
|
|
|
on: |
|
push: |
|
tags: |
|
- 'v[0-9]+.[0-9]+.[0-9]+*' |
|
|
|
jobs: |
|
publish: |
|
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 |
|
runs-on: ubuntu-latest |
|
steps: |
|
- uses: actions/checkout@v4 |
|
# Needed for commit and push changes |
|
with: |
|
ref: ${{ github.head_ref }} |
|
fetch-depth: 0 # To get all tags |
|
|
|
- name: Upload LICENSE to the release assets |
|
uses: softprops/action-gh-release@v2 |
|
if: startsWith(github.ref, 'refs/tags/') |
|
with: |
|
files: LICENSE |
|
|
|
- uses: subosito/flutter-action@v2 |
|
with: |
|
channel: 'stable' |
|
cache: true |
|
|
|
- name: Check flutter version |
|
run: flutter --version |
|
|
|
- name: Enable Local Dev |
|
run: ./scripts/enable_local_dev.sh |
|
|
|
- name: Install dependencies |
|
run: flutter pub get |
|
|
|
# This is needed in order for the authentication to success |
|
# dart pub token add https://pub.dev --env-var PUB_TOKEN |
|
# Requests to "https://pub.dev" will now be authenticated using the secret token stored in the environment variable "PUB_TOKEN". |
|
- uses: dart-lang/setup-dart@v1 |
|
## dart-lang/setup-dart/.github/workflows/publish.yml@v1 |
|
# - 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 |
|
|
|
# TODO: We might automate updating the CHANGELOG.md for all the packages too (update Development notes too if you did) |
|
# Before publishing the new packages, update the version for all the packages first |
|
|
|
# Extract version from the tag (handles optional 'v' prefix) |
|
- name: Extract version from the release tag |
|
id: extract_version |
|
run: | |
|
version=$(echo ${GITHUB_REF} | sed 's/^refs\/tags\/\(.*\)$/\1/') |
|
echo "VERSION=${version}" >> $GITHUB_OUTPUT |
|
|
|
- name: Update the version & CHANGELOG for all the packages |
|
run: dart ./scripts/regenerate_versions.dart ${{ steps.extract_version.outputs.VERSION }} |
|
|
|
- name: Checkout to the master branch |
|
run: git checkout master |
|
|
|
- name: Commit the changes of the updated version & CHANGELOG for all the packages |
|
id: auto-commit-action |
|
uses: stefanzweifel/git-auto-commit-action@v5 |
|
with: |
|
commit_message: "chore(version): update to version ${{ steps.extract_version.outputs.VERSION }}" |
|
|
|
- name: Run if changes have been detected |
|
if: steps.auto-commit-action.outputs.changes_detected == 'true' |
|
run: echo "The changes of the previous step has been done." |
|
|
|
- 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 dart_quill_delta |
|
run: flutter pub publish --force |
|
working-directory: ./dart_quill_delta/ |
|
|
|
- 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/ |
|
|
|
- name: Publish quill_html_converter |
|
run: flutter pub publish --force |
|
working-directory: ./quill_html_converter/ |
|
|
|
- name: Publish quill_pdf_converter |
|
run: flutter pub publish --force |
|
working-directory: ./quill_pdf_converter/
|
|
|